vendor/bundle/ruby/1.8/gems/rufus-scheduler-2.0.16/lib/rufus/sc/scheduler.rb
# The default, plain, implementation. If 'blocking' is true, will simply
# call the block and return when the block is done.
# Else, it will call the block in a dedicated thread.
#
# TODO : clarify, the blocking here blocks the whole scheduler, while
# EmScheduler blocking triggers for the next tick. Not the same thing ...
#
The default, plain, implementation. If 'blocking' is true, will simply
call the block and return when the block is done.
Else, it will call the block in a dedicated thread.


The default plain implementation . If ' blocking ' is true will simply call the block and return when the block is done . Else it will call the block in a dedicated thread .
def trigger_job(params, &block)
      if params[:blocking]
        block.call
      elsif m = params[:mutex]
        m = (@mutexes[m.to_s] ||= Mutex.new) unless m.is_a?(Mutex)
        Thread.new { m.synchronize { block.call } }
      else
        Thread.new { block.call }
      end
    end
def trigger_job ( params , & block ) if params [ :blocking ] block . call elsif m = params [ :mutex ] m = ( @mutexes [ m . to_s ] ||= Mutex . new ) unless m . is_a? ( Mutex ) Thread . new { m . synchronize { block . call } } else Thread . new { block . call } end end
The default, plain, implementation.
The default plain implementation .
params
block