All Projects → mattyr → sidecloq

mattyr / sidecloq

Licence: MIT license
Recurring / Periodic / Scheduled / Cron job extension for Sidekiq

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to sidecloq

Schedule Bundle
Schedule Cron jobs (commands/callbacks/bash scripts) within your Symfony application.
Stars: ✭ 216 (+166.67%)
Mutual labels:  cron, schedule
Simple scheduler
An enhancement for Heroku Scheduler + Sidekiq for scheduling jobs at specific times.
Stars: ✭ 127 (+56.79%)
Mutual labels:  sidekiq, cron
Forest
分布式任务调度平台,分布式,任务调度,schedule,scheduler
Stars: ✭ 231 (+185.19%)
Mutual labels:  cron, schedule
Sleepto
An alternative to traditional task schedulers
Stars: ✭ 98 (+20.99%)
Mutual labels:  cron, schedule
croner
Trigger functions and/or evaluate cron expressions in JavaScript. No dependencies. Most features. All environments.
Stars: ✭ 169 (+108.64%)
Mutual labels:  cron, schedule
Cron
A cron expression parser in Rust
Stars: ✭ 132 (+62.96%)
Mutual labels:  cron, schedule
Sidekiq Scheduler
Lightweight job scheduler extension for Sidekiq
Stars: ✭ 1,198 (+1379.01%)
Mutual labels:  sidekiq, cron
Mantra
A simple cron-like scheduler for a single command
Stars: ✭ 24 (-70.37%)
Mutual labels:  cron, schedule
delay-timer
Time-manager of delayed tasks. Like crontab, but synchronous asynchronous tasks are possible scheduling, and dynamic add/cancel/remove is supported.
Stars: ✭ 257 (+217.28%)
Mutual labels:  cron, schedule
legacy-bottlerockets
Node.js high availability queue and scheduler for background job processing
Stars: ✭ 25 (-69.14%)
Mutual labels:  cron, schedule
Jobber
An alternative to cron, with sophisticated status-reporting and error-handling
Stars: ✭ 1,217 (+1402.47%)
Mutual labels:  cron, schedule
watchman
📆 更夫(watchman)是一款可视化的定时任务配置 Web 工具,麻麻不用担心我漏掉任何更新啦!
Stars: ✭ 40 (-50.62%)
Mutual labels:  cron, schedule
Wp Missed Schedule
Find only missed schedule posts, every 15 minutes, and republish correctly 10 items each session. The Original plugin (only this) no longer available on WordPress.org for explicit author request! Compatible with WP 2.1+ to 4.9+ and 5.0-beta3 (100.000+ installs 300.000+ downloads 2016-04-13) Please: do not install unauthorized malware cloned forked!
Stars: ✭ 69 (-14.81%)
Mutual labels:  cron, schedule
Schedule
Schedule module for Nest framework (node.js) ⏰
Stars: ✭ 137 (+69.14%)
Mutual labels:  cron, schedule
Crontab
Parse Cron Expressions, Compose Cron Expression Strings and Caluclate Execution Dates.
Stars: ✭ 62 (-23.46%)
Mutual labels:  cron, schedule
Activejob Scheduler
A background job scheduler for any queue backend
Stars: ✭ 24 (-70.37%)
Mutual labels:  sidekiq, schedule
Gocron
Easy and fluent Go cron scheduling. This is a fork from https://github.com/jasonlvhit/gocron
Stars: ✭ 605 (+646.91%)
Mutual labels:  cron, schedule
Crono
A time-based background job scheduler daemon (just like Cron) for Rails
Stars: ✭ 637 (+686.42%)
Mutual labels:  cron, schedule
EasyCronJob
This repository provides easy cron job to your application on IHostedService.
Stars: ✭ 66 (-18.52%)
Mutual labels:  cron, recurring
aws-tag-sched-ops
Retired, please see https://github.com/sqlxpert/lights-off-aws
Stars: ✭ 24 (-70.37%)
Mutual labels:  cron, schedule

Sidecloq

Sidecloq

Build Status Gem Version Code Climate Test Coverage

Recurring / Periodic / Scheduled / Cron job extension for Sidekiq

Why

There are several options for running periodic tasks with Sidekiq, including sidekiq-scheduler, sidekiq-cron, as well as Sidekiq Enterprise. Each tackles the problem slightly differently. Sidecloq is inspired by various facets of these projects, as well as resque-scheduler. I urge you to take a look at all of these options to see what works best for you.

Sidecloq is:

  • Lightweight: Celluloid is not required. This coincides well with Sidekiq 4/5, which no longer use Celluloid.
  • Clean: Sidecloq leverages only the public API of Sidekiq, and does not pollute the Sidekiq namespace.
  • Easy to deploy: Sidecloq boots with all Sidekiq processes, automatically. Leader election ensures only one process enqueues jobs, and a new leader is automatically chosen should the current leader die.
  • Easy to configure: Schedule configuration is done in YAML, using the familiar cron syntax. No special DSL or job class mixins required.

Installation

Add this line to your application's Gemfile:

gem 'sidecloq'

Tested on MRI > 2 and JRuby 9k. Basically, if you can run Sidekiq, you can run Sidecloq. Note that Sidekiq >= 5 does not support MRI ruby < 2.2.2.

Configuration

Quickstart

Tell Sidecloq where your schedule file is located:

Sidecloq.configure do |config|
  config[:schedule_file] = "path/to/myschedule.yml"
end

Rails

If using Rails, and your schedule is located at config/sidecloq.yml, Sidecloq will find the schedule automatically (ie, you don't have to use the above configuration block).

Schedule file format

Example:

my_scheduled_job: # a unique name for this schedule
  class: Jobs::DoWork # the job class
  args: [100]       # (optional) set of arguments
  cron: "* * * * *" # cron formatted schedule
  queue: "queue_name" # Sidekiq queue for job

my_scheduled_job_with_args:
  class: Jobs::WorkerWithArgs
  args:
    batch_size: 100
  cron: "1 1 * * *"
  queue: "queue_name"

my_other_scheduled_job:
  class: Jobs::AnotherClassName
  cron: "1 1 * * *"
  queue: "a_different_queue"

Rails

If using Rails, you can nest the schedules under top-level environment keys, and Sidecloq will select the correct group based on the Rails environment. This is useful for development/staging scenarios. For example:

production:
  # these will only run in production
  my_scheduled_job:
    class: Jobs::ClassName
    cron: "* * * * *"
    queue: "queue_name"

staging:
  # this will only run in staging
  my_other_scheduled_job:
    class: Jobs::AnotherClassName
    cron: "1 1 * * *"
    queue: "a_different_queue"

Web Extension

Add Sidecloq::Web after Sidekiq::Web:

require 'sidekiq/web'
require 'sidecloq/web'

This will add a "Recurring" tab to the sidekiq web ui, where the loaded schedules are displayed. You can enqueue a job immediately by clicking it's corresponding "Enqueue now" button.

Sidecloq web ui extension screenshot

Notes

If you are running MRI < 2.2.2, you will need to make sure you are using rack < 2.0. You can do this by adding:

gem 'rack', '< 2.0'

To your app's Gemfile. (This will also keep you from using the 5.x series of Sidekiq, as it requires MRI > 2.2.2).

Contributing

Bug reports and pull requests are welcome.

License

The gem is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].