Class: WEEL::Continue

Inherits:
Object
  • Object
show all
Defined in:
lib/weel.rb

Overview

}}}

Instance Method Summary collapse

Constructor Details

#initializeContinue

{{{



423
424
425
426
# File 'lib/weel.rb', line 423

def initialize
  @q = Queue.new
  @m = Mutex.new
end

Instance Method Details

#clearObject



435
436
437
# File 'lib/weel.rb', line 435

def clear
 @q.clear
end

#continue(*args) ⇒ Object



432
433
434
# File 'lib/weel.rb', line 432

def continue(*args)
  @q.push(args.length <= 1 ? args[0] : args)
end

#waitObject



438
439
440
# File 'lib/weel.rb', line 438

def wait
  @q.deq
end

#waiting?Boolean

Returns:

  • (Boolean)


427
428
429
430
431
# File 'lib/weel.rb', line 427

def waiting?
  @m.synchronize do
    !@q.empty?
  end
end