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

midget_jobs

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

midget_jobs

  • 0.2.8
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

MidgetJobs

MidgetJobs is simple implementation of background jobs for Ruby on Rails. I does not meant to be used without it. It is connected to ActiveJob and PostgreSQL using its triggers, notifications and listening.

Update from 0.1.7 to 0.2.0

There is new column runner in midget_jobs table! It is used to recognise who will run particular job (if there are multiple application over one database)

I added new configuration to Initializer. Add this to your config/initializers/midget_jobs.rb Rails.application.config.x.midget_jobs.runner = Rails.application.class.parent_name

Please create migration with generator rails generate migration AddRunnerToMidgetJob runner:string:index

Installation

Add this line to your application's Gemfile:

gem 'midget_jobs'

And then execute:

$ bundle

Then run

$ rails generate midget_jobs:install

This generator creates an initializer file at config/initializers and migrations to db/migrate

With Puma's multiple workers on production

In file config/initializers/midget_jobs.rb disable start with puma:

...
if Rails.const_defined?('Server')# || $0.include?('puma')

In file config/puma/production.rb update on_worker_boot do block as:

...
on_worker_boot do
  ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
  Rails.logger.debug 'on_worker_boot starting jobs'

  MidgetJobs.initialize_workers
  ...
end
  

Usage

Just use ActiveJob as described in Guides

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jchsoft/midget_jobs. 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 MidgetJob project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 26 Jan 2021

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