Class: Healthyr::EventAgent::AgentThread
- Inherits:
-
Object
- Object
- Healthyr::EventAgent::AgentThread
- Defined in:
- lib/healthyr/event_agent.rb
Instance Method Summary collapse
-
#initialize(duration, &block) ⇒ AgentThread
constructor
A new instance of AgentThread.
Constructor Details
#initialize(duration, &block) ⇒ AgentThread
Returns a new instance of AgentThread.
37 38 39 40 41 42 43 44 45 |
# File 'lib/healthyr/event_agent.rb', line 37 def initialize(duration, &block) Thread.abort_on_exception = true Thread.new do while true sleep duration block.call end end end |