Class: ThrottleQueue::FG
- Inherits:
-
Object
- Object
- ThrottleQueue::FG
- Defined in:
- lib/throttle-queue.rb
Overview
:nodoc: all
Instance Method Summary collapse
- #arity ⇒ Object
- #call(*args) ⇒ Object
-
#initialize(block, h) ⇒ FG
constructor
A new instance of FG.
- #join ⇒ Object
- #kill ⇒ Object
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
#arity ⇒ Object
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 |
#join ⇒ Object
157 158 159 |
# File 'lib/throttle-queue.rb', line 157 def join @thread.join end |
#kill ⇒ Object
154 155 156 |
# File 'lib/throttle-queue.rb', line 154 def kill @thread.kill end |