Class: WEEL::Continue

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

Overview

}}}

Instance Method Summary collapse

Constructor Details

#initializeContinue

{{{



391
392
393
394
# File 'lib/weel.rb', line 391

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

Instance Method Details

#clearObject



403
404
405
# File 'lib/weel.rb', line 403

def clear
 @q.clear
end

#continue(*args) ⇒ Object



400
401
402
# File 'lib/weel.rb', line 400

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

#waitObject



406
407
408
# File 'lib/weel.rb', line 406

def wait
  @q.deq
end

#waiting?Boolean

Returns:

  • (Boolean)


395
396
397
398
399
# File 'lib/weel.rb', line 395

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