Creates a worker instance that exposes a module via RPC.
The module configuration type.
The worker configuration containing the module implementation.
The worker instance.
This function sets up the message listeners for the worker (Dedicated or Shared) and handles the connection lifecycle. It returns the event stream which contains the client configuration.
const api = { hello: () => "world"};expose(api); Copy
const api = { hello: () => "world"};expose(api);
Creates a worker instance that exposes a module via RPC.