Two requests hit your agent at the same time. Both want a 30-second answer. Without a scheduler, the second caller waits 30 seconds for the first one to finish, then 30 more for their own. A single-threaded agent is a queue of one — and queues of one are how production starts melting. The scheduler sits between the HTTP layer and the worker that actually runs your handler. Submission is non-blocking — the caller gets aDocumentation Index
Fetch the complete documentation index at: https://docs.getbindu.com/llms.txt
Use this file to discover all available pages before exploring further.
task_id immediately. Workers pull tasks from the queue and execute them in parallel. The agent stops being a bottleneck and starts being a service.
In memory for local dev, Redis for production. Same bindufy(config, handler) either way; you just flip two environment variables.
Single process? In-memory is fine. Multiple processes or restart-survival required?
Switch to Redis with two env vars. Details below.
How the Bindu Scheduler Works
The scheduler sits between the TaskManager and the worker pool. When a task is submitted, the TaskManager enqueues the task ID. Workers dequeue task IDs and execute them. The storage layer holds the full task data.The Scheduling Model
Non-blocking
Task submission returns immediately. Execution happens asynchronously in a worker.
Concurrent
Multiple workers pull from the same queue and execute tasks in parallel.
Durable
Redis-backed queue survives agent restarts. In-flight tasks are not lost.
Backends
Bindu supports two scheduler backends:| Memory | Redis | |
|---|---|---|
| Setup | None | Requires Redis instance |
| Durability | Lost on restart | Survives restarts |
| Multi-worker | Single process only | Distributed workers |
| Use case | Local development | Production |
| Config | "type": "memory" | "type": "redis" |
Configuration
Scheduler backends are picked via environment variables. Same pattern as Storage — connection strings don’t belong in a Python dict that ends up in git.Memory (development)
uv run agent.py while you’re building.
Redis (production)
Put both in
.env for local development; pull them from your orchestrator’s secret
manager in production. The config dict your agent code uses stays clean.The Task Execution Lifecycle
Here is how the scheduler fits into the full task lifecycle: The client never waits for execution. It submits, gets atask_id, and polls or uses push notifications to know when the task is done.
Worker Concurrency
By default, Bindu runs a single worker. You can increase concurrency by configuring the number of workers:Redis Setup
For production deployments, you need a running Redis instance.Docker (Quick Start)
Environment variables
With authentication
Combining Storage and Scheduler
In production, you typically run both Postgres and Redis together:Real-World Use Cases
Handling request bursts
Handling request bursts
When many tasks arrive at once, the queue absorbs the burst. Workers process at
their own pace without dropping requests or blocking the HTTP layer.
Long-running tasks
Long-running tasks
A task that takes minutes to complete does not block the agent from accepting new
requests. The worker handles it in the background while the HTTP server stays
responsive.
Surviving restarts
Surviving restarts
With Redis, tasks that were queued but not yet started survive an agent restart.
When the agent comes back up, workers pick up where the queue left off.
Horizontal scaling
Horizontal scaling
Deploy multiple agent instances behind a load balancer, all pointing at the same
Redis queue. Tasks are distributed across instances automatically. No coordination
code required.
Security Best Practices
Use environment variables
Redis connection strings don’t belong in a Python dict that ends up in git. Use
REDIS_URL in .env or your orchestrator’s secret manager.Enable Redis Auth
In production, configure Redis with a password and use TLS if the connection
crosses a network boundary.