Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

active_scheduler

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

active_scheduler

  • 0.7.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Gem VersionBuild Status Coveralls branchCode Climate

active_scheduler

active_scheduler is a gem to take a standard schedule one would use with resque scheduler and wraps it to work with ActiveJob.

Currently only Resque is supported, but pull requests to add other queues (sidekiq, etc) would be welcomed!

Requirements/Support

  • Ruby 2.0+
  • ActiveJob
    • 4.2 is tested and used in production
    • 5.0-6.0 is tested against CI, but I haven't tried it in production.
  • Resque
  • Resque Scheduler

Setup

Installation

Add active_scheduler to your Gemfile.

Usage

In your Resque initializer:

require 'resque/server'
require 'resque/scheduler/server'
require 'active_scheduler'

# ... Set up your Resque ...
...

yaml_schedule    = YAML.load_file("#{Rails.root}/config/resque_schedule.yaml") || {}
wrapped_schedule = ActiveScheduler::ResqueWrapper.wrap yaml_schedule
Resque.schedule  = wrapped_schedule

Example Format

simple_job:
  every: "30s"
  queue: "simple"
  class: "SimpleJob"
  args:
    -
  description: "It's a simple job."

ThisIsTheClass:
  cron: "* * * *"
  queue: 'cronny'
  description: "Will call the ThisIsTheClass class"

Only classes that are descended from ActiveJob::Base will be wrapped

Job Classes With Named Args

If you have a job class that uses named arguments you can specify that. args should be a hash nested in the array and you need to add the named_args key.

simple_job:
  every: "30s"
  queue: "simple"
  class: "SimpleJob"
  args:
    - foo: 1
      bar: 2
  description: "It's a simple job."
  named_args: true

Credits

License

MIT

FAQs

Package last updated on 07 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc