class Rx::ImmediateScheduler

Represents an object that schedules units of work to run immediately on the current thread.

Public Instance Methods

schedule_relative_with_state(state, due_time, action) click to toggle source
# File lib/rx/concurrency/immediate_scheduler.rb, line 21
def schedule_relative_with_state(state, due_time, action)
  raise ArgumentError.new 'action cannot be nil' unless action

  dt = Rx::Scheduler.normalize due_time
  sleep dt if dt > 0
  action.call AsyncLockScheduler.new, state
end
schedule_with_state(state, action) click to toggle source

Schedules an action to be executed.

# File lib/rx/concurrency/immediate_scheduler.rb, line 16
def schedule_with_state(state, action)
  raise ArgumentError.new 'action cannot be nil' unless action
  action.call AsyncLockScheduler.new, state
end