Class: Rbgo::CoRun::Scheduler

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/rbgo/corun.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#check_intervalObject

Returns the value of attribute check_interval.



157
158
159
# File 'lib/rbgo/corun.rb', line 157

def check_interval
  @check_interval
end

#io_machineObject

Returns the value of attribute io_machine.



157
158
159
# File 'lib/rbgo/corun.rb', line 157

def io_machine
  @io_machine
end

#num_threadObject

Returns the value of attribute num_thread.



157
158
159
# File 'lib/rbgo/corun.rb', line 157

def num_thread
  @num_thread
end

Instance Method Details

#schedule(routine, new_thread: false, queue_tag: :default) ⇒ Object



352
353
354
355
356
357
358
359
360
# File 'lib/rbgo/corun.rb', line 352

def schedule(routine, new_thread: false, queue_tag: :default)
  if new_thread
    msg_queue << [:new_thread, routine, queue_tag]
  else
    queue = get_queue(queue_tag)
    queue << routine
  end
  nil
end