New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

schdlr

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

schdlr

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Schdlr

A minimal library for scheduling jobs for later execution.

Installation

Add this line to your application's Gemfile:

gem 'schdlr', git: 'https://github.com/devsfutter/schdlr.git'

And then execute:

$ bundle

Usage


class Job < Schdlr::Job
    attr_accessor :id
    def perform
        puts "#{Time.now}: Job2 doing something with id: ##{id}"
        return true
    end
end

class JobThatFail < Schdlr::Job
    attr_accessor :id
    def perform
        puts "#{Time.now}: JobThatFail doing something with id: ##{id}"
        fail!('missing argument :id') if id.nil?
    end
end

@queue = Schdlr::Queue::Sqlite.new
@schhlr = Schdlr.new(@queue)

job1 = Job.new(id: '12344')
job2 = JobThatFail.new

@schhlr.now(job1) #=> schhlr.at(Time.now, job1)
at_time = Time.new(2019,2,2)
@schhlr.at(at_time, job2)
#Start processing queue
@schhlr.start!
# => 2019-01-27 13:40:21 +0100: Job2 doing something with id: #12344
# (time passes by)
# => 2019-02-02 00:00:00 +0100: JobThatFail doing something with id: #
#Stop processing queue
@schhlr.stop!

TODO

  • Failed tasks stays in the queue, they should have a status to avoid retrying failed tasks.
  • Improve test suite.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/devsfutter/schdlr. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

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

Code of Conduct

Everyone interacting in the Schdlr project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 28 Jan 2019

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