Class: WEEL::Continue

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

Overview

}}}

Instance Method Summary collapse

Constructor Details

#initializeContinue

{{{



274
275
276
277
# File 'lib/weel.rb', line 274

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

Instance Method Details

#clearObject



286
287
288
# File 'lib/weel.rb', line 286

def clear
 @q.clear
end

#continue(*args) ⇒ Object



283
284
285
# File 'lib/weel.rb', line 283

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

#waitObject



289
290
291
# File 'lib/weel.rb', line 289

def wait
  @q.deq
end

#waiting?Boolean

Returns:

  • (Boolean)


278
279
280
281
282
# File 'lib/weel.rb', line 278

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