Class: WEEL::Continue

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

Overview

}}}

Instance Method Summary collapse

Constructor Details

#initializeContinue

{{{



293
294
295
296
# File 'lib/weel.rb', line 293

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

Instance Method Details

#clearObject



305
306
307
# File 'lib/weel.rb', line 305

def clear
 @q.clear
end

#continue(*args) ⇒ Object



302
303
304
# File 'lib/weel.rb', line 302

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

#waitObject



308
309
310
# File 'lib/weel.rb', line 308

def wait
  @q.deq
end

#waiting?Boolean

Returns:

  • (Boolean)


297
298
299
300
301
# File 'lib/weel.rb', line 297

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