Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
tasker-worker
Worker foundation for the Tasker workflow system. Executes workflow steps with event-driven processing, multi-language FFI support, and configurable deployment modes.
Overview
tasker-worker processes workflow steps dispatched by the orchestration server. It supports Rust-native handlers and FFI-based handlers for Ruby, Python, and TypeScript. The worker uses a dual-channel architecture with push notifications for low latency and polling for reliability.
Architecture
┌─────────────────┐ ┌──────────────────────┐ ┌──────────────────────┐
│ WorkerBootstrap │───▶│ WorkerEventSystem │───▶│ HandlerDispatchSvc │
│ (Config-Driven) │ │ (Push + Poll) │ │ (Semaphore-Bounded) │
└─────────────────┘ └──────────────────────┘ └──────────────────────┘
│ │
▼ ▼
┌─────────────────┐ ┌───────────────────┐
│ PostgreSQL │ │ Step Handlers │
│ LISTEN/NOTIFY │ │ ┌───────────────┐ │
│ + Fallback Poll │ │ │ Rust (native) │ │
└─────────────────┘ │ │ Ruby (FFI) │ │
│ │ Python (PyO3) │ │
│ │ TypeScript │ │
│ └───────────────┘ │
└───────────────────┘
Key Features
- Event-driven processing — real-time PostgreSQL LISTEN/NOTIFY with fallback polling
- Three deployment modes —
PollingOnly,EventDrivenOnly,Hybrid(recommended) - Multi-language FFI — Ruby via Magnus, Python via PyO3, TypeScript via C ABI
- Semaphore-bounded dispatch — configurable concurrency limits per worker
- Batch processing — aggregate multiple rows into single handler invocations
- Handler capabilities — declarative traits:
APICapable,BatchableCapable,DecisionCapable - REST and gRPC APIs — health monitoring, status, handler registration
- Database-as-API — workers hydrate full context from step message UUIDs
Deployment Modes
| Mode | Latency | Reliability | Use Case |
|---|---|---|---|
PollingOnly |
Higher (~1s) | High | Simple deployments, no pg_notify |
EventDrivenOnly |
Lowest (<10ms) | Lower | Low-latency requirements |
Hybrid |
Low (<10ms) | Highest | Recommended — push + poll fallback |
Usage
Rust Worker
use ;
async
Handler Development
Handlers implement process() and optionally process_results():
use ;
;
For FFI handlers (Ruby, Python, TypeScript), see the cross-language development guide.
Running
# Start the worker server (requires PostgreSQL + orchestration)
# Or with Docker Compose
Default ports: REST on 8081, gRPC on 9191.
Features
| Feature | Description | Default |
|---|---|---|
web-api |
Axum REST API with OpenAPI docs | Yes |
grpc-api |
Tonic gRPC API with reflection | Yes |
postgres |
PostgreSQL via SQLx | Yes |
test-utils |
Test helpers and factories | Yes |
tokio-console |
Runtime introspection | No |
Configuration
The worker reads from config/tasker/base/worker.toml with environment overrides:
[]
= true
= "0.0.0.0"
= 8081
[]
= "hybrid"
[]
= true
= 100
[]
= true
= 5
License
MIT License — see LICENSE for details.
Contributing
See the Tasker Core contributing guide and Code of Conduct.