Class: Startback::Event::Agent
- Inherits:
-
Object
- Object
- Startback::Event::Agent
- Includes:
- Support::OperationRunner, Support::Robustness
- Defined in:
- lib/startback/event/agent.rb
Overview
An agent listen to specific events and react with its ‘call` method.
This class is intended to be subclasses and the following methods overriden:
- install_listeners that installs sync and async listeners
- call to create a context and implement reaction behavior
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#engine ⇒ Object
readonly
Returns the value of attribute engine.
Instance Method Summary collapse
-
#initialize(engine, type = :all) ⇒ Agent
constructor
A new instance of Agent.
Methods included from Support::Robustness
#log, #monitor, #stop_errors, #try_max_times
Methods included from Support::OperationRunner
Constructor Details
#initialize(engine, type = :all) ⇒ Agent
Returns a new instance of Agent.
17 18 19 20 21 22 |
# File 'lib/startback/event/agent.rb', line 17 def initialize(engine, type = :all) @engine = engine @context = nil @type = type install_listeners end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
24 25 26 |
# File 'lib/startback/event/agent.rb', line 24 def context @context end |
#engine ⇒ Object (readonly)
Returns the value of attribute engine.
23 24 25 |
# File 'lib/startback/event/agent.rb', line 23 def engine @engine end |