Module: Agent

Defined in:
lib/agent/uuid.rb,
lib/agent/go.rb,
lib/agent/pop.rb,
lib/agent/once.rb,
lib/agent/push.rb,
lib/agent/error.rb,
lib/agent/queue.rb,
lib/agent/errors.rb,
lib/agent/queues.rb,
lib/agent/channel.rb,
lib/agent/version.rb,
lib/agent/notifier.rb,
lib/agent/selector.rb,
lib/agent/wait_group.rb,
lib/agent/blocking_once.rb,
lib/agent/queue/buffered.rb,
lib/agent/queue/unbuffered.rb

Overview

Borrowed from Celluloid. Using thread locals instead of extending the base Thread class, though.

Defined Under Namespace

Modules: Errors, Queues, UUID Classes: BlockingOnce, Channel, Error, Notifier, Once, Pop, Push, Queue, Selector, WaitGroup

Constant Summary collapse

VERSION =
"0.12.0"

Class Method Summary collapse

Class Method Details

.channel!(*args) ⇒ Object



8
9
10
# File 'lib/agent/channel.rb', line 8

def self.channel!(*args)
  Channel.new(*args)
end

.go!(*args) ⇒ Object



5
6
7
8
# File 'lib/agent/go.rb', line 5

def self.go!(*args)
  raise Errors::BlockMissing unless block_given?
  Thread.new(*args){|*a| yield(*a) }
end

.select! {|selector| ... } ⇒ Object

Yields:

  • (selector)

Raises:



9
10
11
12
13
14
# File 'lib/agent/selector.rb', line 9

def self.select!
  raise Errors::BlockMissing unless block_given?
  selector = Selector.new
  yield selector
  selector.select
end