Custom Adapter
A custom adapter connects the host orchestrator to a worker backend by implementing WorkerGateway.
Adapters that need out-of-band cancellation should observe options.signal inside dispatch().
Usage
Production adapters should add cleanup for pending jobs, multiple workers, worker health, and durable queues if needed.
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 Worker resource and should terminate it during process cleanup.