Class: MessageBus::TimerThread::Cancelable

Inherits:
Object
  • Object
show all
Defined in:
lib/message_bus/timer_thread.rb

Defined Under Namespace

Classes: NoOp

Constant Summary collapse

NOOP =

usually you could just use a blank lambda but an object is ever so slightly faster

NoOp.new

Instance Method Summary collapse

Constructor Details

#initialize(job) ⇒ Cancelable

Returns a new instance of Cancelable.



16
17
18
# File 'lib/message_bus/timer_thread.rb', line 16

def initialize(job)
  @job = job
end

Instance Method Details

#cancelObject



20
21
22
# File 'lib/message_bus/timer_thread.rb', line 20

def cancel
  @job[1] = NOOP
end