Class: Clockwork::DatabaseEvents::Manager

Inherits:
Manager
  • Object
show all
Defined in:
lib/clockwork/database_events/manager.rb

Instance Attribute Summary

Attributes inherited from Manager

#config

Instance Method Summary collapse

Methods inherited from Manager

#configure, #default_configuration, #error_handler, #every, #fire_callbacks, #handle_error, #handler, #initialize, #log, #log_error, #on, #run, #thread_available?, #tick

Constructor Details

This class inherits a constructor from Clockwork::Manager

Instance Method Details

#register(period, job, block, options) ⇒ Object


11
12
13
14
15
16
17
# File 'lib/clockwork/database_events/manager.rb', line 11

def register(period, job, block, options)
  @events << if options[:from_database]
    Clockwork::DatabaseEvents::Event.new(self, period, job, (block || handler), options.fetch(:sync_performer), options)
  else
    Clockwork::Event.new(self, period, job, block || handler, options)
  end
end

#unregister(event) ⇒ Object


7
8
9
# File 'lib/clockwork/database_events/manager.rb', line 7

def unregister(event)
  @events.delete(event)
end