Method: OFlow::Task#flush

Defined in:
lib/oflow/task.rb

#flushObject

Waits for all processing to complete before returning.



318
319
320
321
322
323
324
325
326
327
328
329
330
# File 'lib/oflow/task.rb', line 318

def flush()
  return if @loop.nil?
  @waiting_thread = Thread.current
  begin
    @loop.wakeup()
  rescue
    # ignore
  end
  while busy?
    sleep(2.0)
  end
  @waiting_thread = nil
end