Class: Qwirk::Adapter::Inline::Worker
- Inherits:
-
Object
- Object
- Qwirk::Adapter::Inline::Worker
- Defined in:
- lib/qwirk/adapter/inline/worker.rb
Instance Attribute Summary collapse
-
#response_handle ⇒ Object
Returns the value of attribute response_handle.
Instance Method Summary collapse
-
#acknowledge_message(message) ⇒ Object
We never call worker.start so this method is unnecessary.
- #handle_failure(message, exception, fail_queue_name) ⇒ Object
-
#initialize(name, marshaler) ⇒ Worker
constructor
A new instance of Worker.
- #message_to_object(msg) ⇒ Object
- #ready_to_stop? ⇒ Boolean
-
#receive_message ⇒ Object
We never call worker.start so this method is unnecessary.
- #send_exception(original_message, e) ⇒ Object
- #send_response(original_message, marshaled_object) ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(name, marshaler) ⇒ Worker
Returns a new instance of Worker.
9 10 11 12 |
# File 'lib/qwirk/adapter/inline/worker.rb', line 9 def initialize(name, marshaler) @name = name @marshaler = marshaler end |
Instance Attribute Details
#response_handle ⇒ Object
Returns the value of attribute response_handle.
7 8 9 |
# File 'lib/qwirk/adapter/inline/worker.rb', line 7 def response_handle @response_handle end |
Instance Method Details
#acknowledge_message(message) ⇒ Object
We never call worker.start so this method is unnecessary
19 20 |
# File 'lib/qwirk/adapter/inline/worker.rb', line 19 def () end |
#handle_failure(message, exception, fail_queue_name) ⇒ Object
36 37 38 |
# File 'lib/qwirk/adapter/inline/worker.rb', line 36 def handle_failure(, exception, fail_queue_name) Qwirk.logger.warn("Dropping message that failed: #{}") end |
#message_to_object(msg) ⇒ Object
31 32 33 34 |
# File 'lib/qwirk/adapter/inline/worker.rb', line 31 def (msg) # The publisher has already unmarshaled the object to save hassle here. return msg end |
#ready_to_stop? ⇒ Boolean
43 44 45 |
# File 'lib/qwirk/adapter/inline/worker.rb', line 43 def ready_to_stop? true end |
#receive_message ⇒ Object
We never call worker.start so this method is unnecessary
15 16 |
# File 'lib/qwirk/adapter/inline/worker.rb', line 15 def end |
#send_exception(original_message, e) ⇒ Object
27 28 29 |
# File 'lib/qwirk/adapter/inline/worker.rb', line 27 def send_exception(, e) do_send_response(, Qwirk::RemoteException.new(e)) end |
#send_response(original_message, marshaled_object) ⇒ Object
22 23 24 25 |
# File 'lib/qwirk/adapter/inline/worker.rb', line 22 def send_response(, marshaled_object) # We unmarshal so our workers get consistent messages regardless of the adapter do_send_response(, @marshaler.unmarshal(marshaled_object)) end |
#stop ⇒ Object
40 41 |
# File 'lib/qwirk/adapter/inline/worker.rb', line 40 def stop end |