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

activejob-trackable2

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

activejob-trackable2

  • 0.3.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

ActiveJob::Trackable

Gem Version CircleCI Maintainability

include ActiveJob::Trackable into any jobs you want to track. Tracking jobs will grant you access into the lifetime of each jobs and give you the ability to throttle and debounce similar jobs.

This is useful for cases where you want to make sure that certain jobs are only done at most once per certain period or when you want to reschedule/reconfigure previously scheduled jobs

Usage

This gem is build with composition over inheritance in mind, and so to benefit from it you can start by adding include ActiveJob::Trackable into any jobs you want to track, e.g.

class SampleJob < ApplicationJob
  include ActiveJob::Trackable2

  trackable debounced: true, throttled: 1.day

  def perform(one, two, three); end
end

Calling trackable configures the trackers behavior, which defaulted to doing nothing. Using this, you can tell the trackers to either :debounced, :throttled, or both.

ActiveJob::Trackable::Debounced and ActiveJob::Trackable::Throttled is also available as syntactic sugar

Compatibility

For now, this gem only support delayed_job with activerecord backend, but support for other delayed job backend and other queue adapters are desired.

Installation

Add this line to your application's Gemfile:

gem 'activejob-trackable'

And then execute:

$ bundle

Or install it yourself as:

$ gem install activejob-trackable2

run the generator:

rails generate active_job:trackable

and run the generated migration:

rake db:migrate

Contributing

Any and all kind of help are welcomed! Especially interested in:

  • support for other delayed job backend
  • support for other queue adapters officially supported by activejob itself

feel free to file an issue/PR!

License

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

FAQs

Package last updated on 10 Mar 2023

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