Skip to content

RFC: Calling a product worker from its app #488

Description

@filvecchiato

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

  • RFC document body
  • Implementation — rust-core
  • Implementation — hosts
    • dotli
    • Desktop
    • iOS
    • Android
    • host-cli

Note: RFC number 0027 is also claimed by #420.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions