Class: TorqueBox::Messaging::BackgroundableProcessor

Inherits:
MessageProcessor show all
Defined in:
messaging/lib/torquebox/messaging/backgroundable_processor.rb

Instance Attribute Summary

Attributes inherited from MessageProcessor

#:message

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from MessageProcessor

#initialize, #initialize_proxy, list, lookup, messaging_service_name, #method_missing, #on_error, #process!, #reply

Methods included from ProcessorMiddleware::DefaultMiddleware

default, #middleware

Constructor Details

This class inherits a constructor from TorqueBox::Messaging::MessageProcessor

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class TorqueBox::Messaging::MessageProcessor

Class Method Details

+ (Object) log



47
48
49
# File 'messaging/lib/torquebox/messaging/backgroundable_processor.rb', line 47

def self.log
  @logger ||= TorqueBox::Logger.new( self )
end

+ (Object) log_newrelic_notice(klass)



27
28
29
30
31
# File 'messaging/lib/torquebox/messaging/backgroundable_processor.rb', line 27

def self.log_newrelic_notice(klass)
  @newrelic_notice_logged ||=
    log.warn( "The New Relic agent is loaded, but an issue with the inheritance hierachy of " <<
              klass.name << " prevents us from reporting on its Backgroundable calls." ) || true
end

Instance Method Details

- (Object) on_message(hash)



33
34
35
36
37
38
39
40
41
42
43
44
# File 'messaging/lib/torquebox/messaging/backgroundable_processor.rb', line 33

def on_message(hash)
  FutureResponder.new( Queue.new( hash[:future_queue] ), hash[:future_id], hash[:future_ttl] ).respond do
    klass = hash[:receiver].class
    if klass.respond_to?( :__enable_backgroundable_newrelic_tracing )
      klass.__enable_backgroundable_newrelic_tracing( hash[:method] )
    elsif Backgroundable.newrelic_available? 
      self.class.log_newrelic_notice( klass )
    end
    
    hash[:receiver].send(hash[:method], *hash[:args])
  end
end