Method: GovernorBackground.register

Defined in:
lib/governor_background.rb

.register(job_name, &block) ⇒ Object

Registers this job to be run later. Must be called upon application initialization.

Example:

GovernorBackground.register('twitter_post') do |content|
  Twitter.update(content)
end

Job names must be globally unique. It’s recommended that you preface the job name with the name of the containing plugin.



30
31
32
# File 'lib/governor_background.rb', line 30

def self.register(job_name, &block)
  @@blocks[job_name.to_s] = block
end