class GtkJobQueue

Public Class Methods

new() click to toggle source
# File gtk3/sample/misc/threads.rb, line 13
def initialize
  @queue = Queue.new
  @worker_id = nil
end

Public Instance Methods

push(&job) click to toggle source
# File gtk3/sample/misc/threads.rb, line 18
def push(&job)
  @queue << job
  if @worker_id.nil?
    start_worker
  end
end
stop() click to toggle source
# File gtk3/sample/misc/threads.rb, line 25
def stop
  return if @worker_id.nil?
  GLib::Source.remove(@worker_id)
  @worker_id = nil
end