Skip to content

Latest commit

 

History

History

README.md

Chronis Examples

Example code demonstrating Chronis usage.

Basic Examples

In-memory scheduler with interval and cron jobs.

python examples/quickstart.py

Multi-tenant job scheduling with metadata filtering.

python examples/multitenant.py

Dead Letter Queue (DLQ) pattern using failure handlers.

Demonstrates how to:

  • Capture failed jobs with full error context
  • Store failed jobs in DLQ (in-memory example, easily adaptable to PostgreSQL/Redis)
  • Query and retry failed jobs
  • Track DLQ statistics
python examples/dead_letter_queue.py

Execution history tracking using success/failure handlers.

Demonstrates how to:

  • Log all job executions (success and failure)
  • Query execution history with filters
  • Generate execution statistics
  • Monitor success rates
python examples/execution_history.py

Adapter Examples

Redis-based storage and distributed locking.

cd examples/redis
docker-compose up -d
python redis_example.py

See redis/README.md for details.

PostgreSQL storage with JSONB schema.

cd examples/postgres
docker-compose up -d
python postgres_example.py

See postgres/README.md for details.

Setup

# Install with dependencies
pip install chronis[all]

# Or install from source
pip install -e ".[all]"