Class: WEEL::Continue
- Inherits:
-
Object
- Object
- WEEL::Continue
- Defined in:
- lib/weel.rb
Overview
}}}
Instance Method Summary collapse
- #clear ⇒ Object
- #continue(*args) ⇒ Object
-
#initialize ⇒ Continue
constructor
{{{.
- #wait ⇒ Object
- #waiting? ⇒ Boolean
Constructor Details
#initialize ⇒ Continue
{{{
401 402 403 404 |
# File 'lib/weel.rb', line 401 def initialize @q = Queue.new @m = Mutex.new end |
Instance Method Details
#clear ⇒ Object
413 414 415 |
# File 'lib/weel.rb', line 413 def clear @q.clear end |
#continue(*args) ⇒ Object
410 411 412 |
# File 'lib/weel.rb', line 410 def continue(*args) @q.push(args.length <= 1 ? args[0] : args) end |
#wait ⇒ Object
416 417 418 |
# File 'lib/weel.rb', line 416 def wait @q.deq end |
#waiting? ⇒ Boolean
405 406 407 408 409 |
# File 'lib/weel.rb', line 405 def waiting? @m.synchronize do !@q.empty? end end |