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
{{{
415 416 417 418 |
# File 'lib/weel.rb', line 415 def initialize @q = Queue.new @m = Mutex.new end |
Instance Method Details
#clear ⇒ Object
427 428 429 |
# File 'lib/weel.rb', line 427 def clear @q.clear end |
#continue(*args) ⇒ Object
424 425 426 |
# File 'lib/weel.rb', line 424 def continue(*args) @q.push(args.length <= 1 ? args[0] : args) end |
#wait ⇒ Object
430 431 432 |
# File 'lib/weel.rb', line 430 def wait @q.deq end |
#waiting? ⇒ Boolean
419 420 421 422 423 |
# File 'lib/weel.rb', line 419 def waiting? @m.synchronize do !@q.empty? end end |