Module: TorqueBox::Messaging::Backgroundable
- Defined in:
- lib/torquebox/messaging/backgroundable.rb
Overview
Backgroundable provides mechanism for executing an object’s methods asynchronously.
Defined Under Namespace
Modules: ClassMethods, Util Classes: BackgroundProxy
Constant Summary collapse
- MUTEX =
Mutex.new
Class Method Summary collapse
- .included(base) ⇒ Object
-
.newrelic_available? ⇒ Boolean
Signals if the newrelic gem is loaded.
Instance Method Summary collapse
-
#background(options = { }) ⇒ Future
Allows you to background any method that has not been marked as a backgrounded method via ClassMethods#always_background.
Class Method Details
.included(base) ⇒ Object
33 34 35 36 |
# File 'lib/torquebox/messaging/backgroundable.rb', line 33 def self.included(base) base.extend(ClassMethods) base.send(:include, FutureStatus) end |
.newrelic_available? ⇒ Boolean
Signals if the newrelic gem is loaded.
39 40 41 |
# File 'lib/torquebox/messaging/backgroundable.rb', line 39 def self.newrelic_available? defined?(NewRelic::Agent) end |
Instance Method Details
#background(options = { }) ⇒ Future
Allows you to background any method that has not been marked as a backgrounded method via TorqueBox::Messaging::Backgroundable::ClassMethods#always_background.
48 49 50 |
# File 'lib/torquebox/messaging/backgroundable.rb', line 48 def background( = { }) BackgroundProxy.new(self, ) end |