Class: Thread

Inherits:
Object
  • Object
show all
Defined in:
lib/thread/promise.rb,
lib/thread/process.rb,
lib/thread/channel.rb,
lib/thread/future.rb,
lib/thread/every.rb,
lib/thread/delay.rb,
lib/thread/pool.rb,
lib/thread/pipe.rb

Defined Under Namespace

Classes: Channel, Delay, Every, Future, Pipe, Pool, Process

Class Method Summary collapse

Class Method Details

.channel(*args, &block) ⇒ Object

Helper to create a channel.



106
107
108
# File 'lib/thread/channel.rb', line 106

def self.channel (*args, &block)
	Thread::Channel.new(*args, &block)
end

.delay(&block) ⇒ Object

Helper to create Thread::Delay



84
85
86
# File 'lib/thread/delay.rb', line 84

def self.delay (&block)
	Thread::Delay.new(&block)
end

.every(every, &block) ⇒ Object

Helper to create an every



187
188
189
# File 'lib/thread/every.rb', line 187

def self.every (every, &block)
	Thread::Every.new(every, &block)
end

.future(pool = nil, &block) ⇒ Object

Helper to create a future



148
149
150
# File 'lib/thread/future.rb', line 148

def self.future (pool = nil, &block)
	Thread::Future.new(pool, &block)
end

.pool(*args, &block) ⇒ Object

Helper to create a pool.



425
426
427
# File 'lib/thread/pool.rb', line 425

def self.pool (*args, &block)
	Thread::Pool.new(*args, &block)
end

.process(&block) ⇒ Object

Helper to create a process.



69
70
71
# File 'lib/thread/process.rb', line 69

def self.process (&block)
	Thread::Process.new(&block)
end

.promiseObject

Helper method to create a promise.



73
74
75
# File 'lib/thread/promise.rb', line 73

def self.promise
	Thread::Promise.new
end

.|(func) ⇒ Object

Helper to create a pipe.



116
117
118
# File 'lib/thread/pipe.rb', line 116

def self.| (func)
	Pipe.new | func
end