Workers & Hooks
Worker builder, middleware, and workflow control.
Worker builder, middleware, and workflow control.
| Method | Description |
|---|---|
worker() → Worker.Builder | Begin building a worker. |
shutdown() | Close every worker started from this client — the programmatic SIGINT/SIGTERM. Each stops dispatching, drains its in-flight handlers, and disposes its worker-scoped resources, exactly as Worker.close() does. A no-op when no worker runs, and safe alongside a direct close(). The client itself stays usable. |
listWorkers() → List<WorkerInfo> | Registered workers (heartbeat + identity). |
| Method | Description |
|---|---|
use(Middleware) | Cross-cutting hooks — onEnqueue, before/after/onError, and the outcome hooks. |
| Method | Description |
|---|---|
listCircuitBreakers() → List<CircuitBreakerState> | Live state of every registered circuit breaker — open/closed/half-open, failure counts, next-probe time. |
| Method | Description |
|---|---|
submitWorkflow(Workflow) / submitWorkflow(Workflow, Map) | Submit a workflow → WorkflowRun. |
workflowStatus(runId) / cancelWorkflow(runId) | Run queries and cancellation. |