Build a Custom Adapter
Implement WorkerGateway to connect the host orchestrator to your worker backend.
To support out-of-band cancellation, observe options.signal inside dispatch().
Usage
A production adapter may also need to clean up pending jobs, manage multiple workers, monitor worker health, and use a durable queue.
In-memory workers can be stopped to unregister handlers and abort active jobs:
For worker/thread, worker.stop() removes the message listener inside the thread. The host still owns the Node.js Worker and should terminate it during process cleanup.