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

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

Instance Method Summary (collapse)

Constructor Details

- (BackgroundProxy) initialize(receiver, options)

Returns a new instance of BackgroundProxy



181
182
183
184
# File 'messaging/lib/torquebox/messaging/backgroundable.rb', line 181

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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(method, *args, &block)

Raises:

  • (ArgumentError)


186
187
188
189
190
# File 'messaging/lib/torquebox/messaging/backgroundable.rb', line 186

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