Kaal

Kaal is a distributed cron scheduler for Ruby that safely executes scheduled tasks across multiple nodes.

Gem CI Maintainability Code Coverage License PostgreSQL Redis


Install the gem

# Gemfile
gem 'kaal'
# Install the gem
bundle install

# Generate the initializer and migrations
bin/rails g kaal:install

Features

  • Scheduler-agnostic: Works with any job system (ActiveJob, Sidekiq, Resque, etc.)
  • Multi-node safe: Ensures single-dispatch execution across all app instances
  • Backend adapters: Redis and Postgres (with in-memory fallback) persist lock coordination, cron definitions, and dispatch records
  • Registry & API: Centralized job registration with deterministic idempotency keys
  • Dispatch recovery: Replays missed runs within a configurable lookback window
  • Cron utilities: Validate, lint, simplify, and humanize via Kaal.valid?, Kaal.lint, Kaal.simplify, and Kaal.to_human
  • i18n keys: Fully localizable weekdays, months, and time phrases (kaal.*)
  • CLI tools: kaal explain, next, run, and Rails Rake tasks (kaal:start, status, etc.)
  • Standalone mode: Launch scheduler via Procfile, systemd, or Kubernetes
  • Rails integration: Railtie auto-loads configuration and Rake tasks
  • Observability: Optional status inspection via kaal:status
  • Graceful shutdown: Handles TERM/INT signals and finishes current tick cleanly
  • Testing: Thread-safe, multi-node safety specs included
  • Development & CI: Bundler, RSpec, RuboCop, GitHub Actions workflows
  • Documentation: README, feature templates, and roadmap included

Professional support

Need help with integrating or customizing kaal for your project? We offer professional support and custom development services. Contact us at sales@codevedas.com for inquiries.

License

MIT © Codevedas Inc.