Class: WEEL::Continue

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

Overview

}}}

Instance Method Summary collapse

Constructor Details

#initializeContinue

{{{



421
422
423
424
# File 'lib/weel.rb', line 421

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

Instance Method Details

#clearObject



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

def clear
 @q.clear
end

#continue(*args) ⇒ Object



430
431
432
# File 'lib/weel.rb', line 430

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

#waitObject



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

def wait
  @q.deq
end

#waiting?Boolean

Returns:

  • (Boolean)


425
426
427
428
429
# File 'lib/weel.rb', line 425

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