Module: Workers

Defined in:
lib/workers.rb,
lib/workers/pool.rb,
lib/workers/task.rb,
lib/workers/event.rb,
lib/workers/timer.rb,
lib/workers/worker.rb,
lib/workers/helpers.rb,
lib/workers/version.rb,
lib/workers/log_proxy.rb,
lib/workers/scheduler.rb,
lib/workers/task_group.rb,
lib/workers/periodic_timer.rb

Defined Under Namespace

Modules: Helpers Classes: Event, LogProxy, PeriodicTimer, Pool, Scheduler, Task, TaskGroup, Timer, Worker

Constant Summary collapse

VERSION =
'0.2.2'

Class Method Summary collapse

Class Method Details

.map(inputs, options = {}, &block) ⇒ Object



36
37
38
39
40
# File 'lib/workers.rb', line 36

def self.map(inputs, options = {}, &block)
  return Workers::TaskGroup.new.map(inputs, options) do |i|
    block.call(i)
  end
end

.poolObject



18
19
20
# File 'lib/workers.rb', line 18

def self.pool
  return @pool ||= Workers::Pool.new
end

.pool=(val) ⇒ Object



22
23
24
25
# File 'lib/workers.rb', line 22

def self.pool=(val)
  @pool.dispose if @pool
  @pool = val
end

.schedulerObject



27
28
29
# File 'lib/workers.rb', line 27

def self.scheduler
  return @scheduler ||= Workers::Scheduler.new
end

.scheduler=(val) ⇒ Object



31
32
33
34
# File 'lib/workers.rb', line 31

def self.scheduler=(val)
  @scheduler.dispose if @scheduler
  @scheduler = val
end