Module: ExcADG::Payload
- Included in:
- Example::Benchmark, Example::Condition, Example::Echo, Example::Faulty, Example::Loop, Example::Receiver, Example::Sleepy, Wrapper::Bin
- Defined in:
- lib/excadg/payload.rb
Overview
Defined Under Namespace
Modules: Example, Wrapper Classes: IncorrectPayloadArity, NoPayloadSet
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
Instance Method Summary collapse
-
#get ⇒ Proc
main method of the payload that holds code to be executed within vertex, vertex takes care of error processing - there is no need to mask exceptions, this method should return a Proc, that: * could receive up to 1 arguments * 1st argument, if specified, is an Array of VStateData from the vertex dependencies * could access @args of the obejct, which was set on object’s constructing.
-
#initialize(args: nil) ⇒ Object
constructor to store arguments for the lambda in the object.
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
9 10 11 |
# File 'lib/excadg/payload.rb', line 9 def args @args end |
Instance Method Details
#get ⇒ Proc
main method of the payload that holds code to be executed within vertex, vertex takes care of error processing - there is no need to mask exceptions, this method should return a Proc, that:
-
could receive up to 1 arguments
-
1st argument, if specified, is an Array of VStateData from the vertex dependencies
-
could access @args of the obejct, which was set on object’s constructing
19 20 21 |
# File 'lib/excadg/payload.rb', line 19 def get raise NoPayloadSet, 'payload is empty' end |
#initialize(args: nil) ⇒ Object
constructor to store arguments for the lambda in the object
implementation implies that child class could implement #sanitize to transform args as needed
27 28 29 |
# File 'lib/excadg/payload.rb', line 27 def initialize args: nil @args = respond_to?(:sanitize) ? send(:sanitize, args) : args end |