Class: ThrottleQueue::FG

Inherits:
Object
  • Object
show all
Defined in:
lib/throttle-queue.rb

Overview

:nodoc: all

Instance Method Summary collapse

Constructor Details

#initialize(block, h) ⇒ FG

Returns a new instance of FG.



139
140
141
142
143
144
145
146
# File 'lib/throttle-queue.rb', line 139

def initialize(block, h)
	@block = block
	@thread = Thread.new {
		Thread.stop
		@block.call *@args
	}
	@h = h
end

Instance Method Details

#arityObject



147
148
149
# File 'lib/throttle-queue.rb', line 147

def arity
	@block.arity
end

#call(*args) ⇒ Object



150
151
152
153
# File 'lib/throttle-queue.rb', line 150

def call(*args)
	@args = args
	@thread.run
end

#joinObject



157
158
159
# File 'lib/throttle-queue.rb', line 157

def join
	@thread.join
end

#killObject



154
155
156
# File 'lib/throttle-queue.rb', line 154

def kill
	@thread.kill
end