How openworkers/openworkers-task-executor works
OpenWorkers Task Executor runs one-off or queued background tasks using the runtime backend selected at build time. The workflow starts at the CLI, NATS, or PostgreSQL queue; the executor obtains the script and payload, invokes the selected task backend, and returns or records the result. JavaScript backends lower module syntax and use native task dispatch or a fetch shim; Wasm delivers tasks through an HTTP component interface. The graph preserves the documented source and backend options. Some listener internals were only partially excerpted, so uncertain internal call paths are omitted.
Main entry points: mod.rs Task API · main.rs CLI and listeners · ops.rs Fetch operations · db.rs Database listener
Components 10
Task sources
- CLI and listeners
src/main.rs - NATS queue
- PostgreSQL queue
Task execution
- Task API
src/task/mod.rs
Runtime backends
- Native task dispatch
src/task/native.rs - Fetch task shim
src/task/shim.rs - Wasm component task
src/task/component.rs
Operations and queues
- Database listener
src/db.rs - Fetch operations
src/ops.rs - HTTP services
Connections 12
- CLI and listeners → NATS queue: subscribes to
src/main.rs - CLI and listeners → Database listener: starts listener
src/main.rs - CLI and listeners → Task API: invokes task
src/main.rs - Database listener → PostgreSQL queue: claims and updates
src/db.rs - Database listener → CLI and listeners: uses execution callback
src/main.rs - Task API → Native task dispatch: selects backend
src/task/mod.rs - Task API → Fetch task shim: selects backend
src/task/mod.rs - Task API → Wasm component task: selects backend
src/task/mod.rs - Native task dispatch → Fetch operations: configures operations
src/task/native.rs - Fetch task shim → Fetch operations: configures operations
src/task/shim.rs - Wasm component task → Fetch operations: configures operations
src/task/component.rs - Fetch operations → HTTP services: sends fetch requests
src/ops.rs