Class: TorqueBox::Messaging::Backgroundable::BackgroundProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/torquebox/messaging/backgroundable.rb

Instance Method Summary collapse

Constructor Details

#initialize(receiver, options) ⇒ BackgroundProxy

Returns a new instance of BackgroundProxy.



173
174
175
176
# File 'lib/torquebox/messaging/backgroundable.rb', line 173

def initialize(receiver, options)
  @receiver = receiver
  @options = options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object

Raises:

  • (ArgumentError)


178
179
180
181
182
# File 'lib/torquebox/messaging/backgroundable.rb', line 178

def method_missing(method, *args, &block)
  @receiver.method_missing(method, *args, &block) unless @receiver.respond_to?(method)
  raise ArgumentError.new("Backgrounding a method with a block argument is not supported. If you need this feature, please file a feature request at http://issues.jboss.org/browse/TORQUE") if block_given?
  Util.publish_message(@receiver, method, args, @options)
end