
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
A simple way to invoke methods asynchronously using Resque. There are a few gems that provide similar functionality. However this this implementation provides more expressive syntax that it gives the caller control over the invocation.
Add this line to your application's Gemfile:
gem 'resque-async'
And then execute:
$ bundle
Or install it yourself as:
$ gem install resque-async
Assuming
class MyObject < ActiveRecord::Base
def self.slow_class_method
end
def slow_instance_method
end
end
Supports Class Methods and ActiveRecord instance methods
MyObject.async(:high).slow_class_method
# ActiveRecord instances will be queued/loaded/invoked asynchronously
MyObject.new.async(:medium).slow_instance_method
Natural synchronous invocation
MyObject.slow_class_method
MyObject.new.slow_instance_method
Support high, medium, low priority out of the box. As well as custom worker/queue
# slow_class_method queued/invoked on 'high' queue
MyObject.async(:high).slow_class_method
# slow_class_method queued/invoked on 'medium' queue
MyObject.async(:medium).slow_class_method
# slow_class_method queued/invoked on 'low' queue
MyObject.async(:low).slow_class_method
OR
class MyCustomerWorker
extend ResqueAsync::Workers::AsyncClassWorker
@queue :crazy
end
MyObject.async(MyCustomerWorker).crazy_priority
resque-async-method hides the fact that a method may be invoked asynchronously. From the caller's perspective things can get really confusing.
With resque-async-method
class MyObject < ActiveRecord::Base
def slow_method
end
async_method :slow_method
end
# is this async or not? What does result equal? Better check the implementation of MyObject
result = MyObject.new.slow_method
With resque-async
class MyObject < ActiveRecord::Base
def slow_method
end
end
# this should be pretty obvious, even years later, that slow_method is invoked async
d = MyObject.new.async(:low).slow_method
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that resque-async demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.