Class NewRelic::Agent::WorkerLoop
In: lib/new_relic/agent/worker_loop.rb
Parent: Object

A worker loop executes a set of registered tasks on a single thread. A task is a proc or block with a specified call period in seconds.

Methods

Attributes

iterations  [R] 
period  [RW] 
propagate_errors  [RW] 

Public Class methods

Optional argument :duration (in seconds) for how long the worker loop runs or :limit (integer) for max number of iterations

Public Instance methods

a simple accessor for @should_run

Run infinitely, calling the registered tasks at their specified call periods. The caller is responsible for creating the thread that runs this worker loop. This will run the task immediately.

Executes the block given to the worker loop, and handles errors.

Reset state that is changed by running the worker loop

Sets @should_run to false. Returns false

[Validate]