Class: Orchestrated::MessageDelivery
- Defined in:
- lib/orchestrated/message_delivery.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#method_name ⇒ Object
Returns the value of attribute method_name.
-
#orchestrated ⇒ Object
Returns the value of attribute orchestrated.
-
#orchestration_id ⇒ Object
Returns the value of attribute orchestration_id.
Instance Method Summary collapse
-
#failure ⇒ Object
delayed_job hands us this message after max_attempts are exhausted.
-
#initialize(orchestrated, method_name, args, orchestration_id) ⇒ MessageDelivery
constructor
A new instance of MessageDelivery.
- #perform ⇒ Object
Constructor Details
#initialize(orchestrated, method_name, args, orchestration_id) ⇒ MessageDelivery
Returns a new instance of MessageDelivery.
5 6 7 8 9 10 11 12 |
# File 'lib/orchestrated/message_delivery.rb', line 5 def initialize(orchestrated, method_name, args, orchestration_id) raise ArgumentError.new('all arguments to MessageDelivery constructor are required') unless orchestrated and method_name and args and orchestration_id self.orchestrated = orchestrated self.method_name = method_name self.args = args self.orchestration_id = orchestration_id end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
3 4 5 |
# File 'lib/orchestrated/message_delivery.rb', line 3 def args @args end |
#method_name ⇒ Object
Returns the value of attribute method_name.
3 4 5 |
# File 'lib/orchestrated/message_delivery.rb', line 3 def method_name @method_name end |
#orchestrated ⇒ Object
Returns the value of attribute orchestrated.
3 4 5 |
# File 'lib/orchestrated/message_delivery.rb', line 3 def orchestrated @orchestrated end |
#orchestration_id ⇒ Object
Returns the value of attribute orchestration_id.
3 4 5 |
# File 'lib/orchestrated/message_delivery.rb', line 3 def orchestration_id @orchestration_id end |
Instance Method Details
#failure ⇒ Object
delayed_job hands us this message after max_attempts are exhausted
25 26 27 28 |
# File 'lib/orchestrated/message_delivery.rb', line 25 def failure orchestration = Orchestration.find(self.orchestration_id) orchestration. end |
#perform ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/orchestrated/message_delivery.rb', line 14 def perform orchestration = Orchestration.find(self.orchestration_id) orchestrated.orchestration = orchestration orchestrated.send(method_name, *args) orchestrated.orchestration = nil orchestration. end |