Source PR: #468 · docs/rfcs/0027-surface-worker-calls.md · @BigTava
Description
A Worker trait adds call_worker, which invokes a named export of the calling product's own worker with a JSON payload and returns the answer.
Motivation
A product's views and its worker have no protocol between them, so work meant to outlive the view runs in the page and dies with it. Without a bounded call, products will ask to hand the worker a function instead.
Requirements
- The request carries no product id — the Host supplies the caller identity.
api_name must be an export the verified archive already declared; nothing loads on demand.
deadline_ms defaults to and is clamped by the Host window.
- Errors are
Unavailable | Invalid | Timeout | Crashed | Version, with Unavailable undifferentiated on purpose.
- The worker manifest declares which executables may call it.
Tasks
Note: RFC number 0027 is also claimed by #420.
Source PR: #468 ·
docs/rfcs/0027-surface-worker-calls.md· @BigTavaDescription
A
Workertrait addscall_worker, which invokes a named export of the calling product's own worker with a JSON payload and returns the answer.Motivation
A product's views and its worker have no protocol between them, so work meant to outlive the view runs in the page and dies with it. Without a bounded call, products will ask to hand the worker a function instead.
Requirements
api_namemust be an export the verified archive already declared; nothing loads on demand.deadline_msdefaults to and is clamped by the Host window.Unavailable | Invalid | Timeout | Crashed | Version, withUnavailableundifferentiated on purpose.Tasks
Note: RFC number 0027 is also claimed by #420.