module ConeyIsland

Constants

VERSION

Public Class Methods

amqp_connection() click to toggle source

BEGIN configuration

# File lib/coney_island.rb, line 8
def self.amqp_connection
  @connection
end
amqp_parameters() click to toggle source
# File lib/coney_island.rb, line 16
def self.amqp_parameters
  @amqp_parameters
end
amqp_parameters=(params) click to toggle source
# File lib/coney_island.rb, line 12
def self.amqp_parameters=(params)
  @amqp_parameters = params
end
cache_jobs() click to toggle source
# File lib/coney_island.rb, line 102
def self.cache_jobs
  ConeyIsland::Submitter.cache_jobs
end
cached_jobs() click to toggle source
# File lib/coney_island.rb, line 106
def self.cached_jobs
  ConeyIsland::Submitter.cached_jobs
end
caching_jobs(&blk) click to toggle source
# File lib/coney_island.rb, line 114
def self.caching_jobs(&blk)
  ConeyIsland::Submitter.caching_jobs(&blk)
end
config() click to toggle source
# File lib/coney_island.rb, line 66
def self.config
  ConeyIsland::Worker.config
end
config=(config_hash) click to toggle source
# File lib/coney_island.rb, line 57
def self.config=(config_hash)
  self.amqp_parameters = config_hash.delete :amqp_connection
  if !self.single_amqp_connection?
    ConeyIsland::Submitter.amqp_parameters = config_hash.delete :amqp_connection_submitter
    ConeyIsland::Worker.amqp_parameters = config_hash.delete :amqp_connection_worker
  end
  ConeyIsland::Worker.config=(config_hash)
end
default_settings() click to toggle source
# File lib/coney_island.rb, line 135
def self.default_settings
  { work_queue: 'default', timeout: 30, delay: 0, highlander: false }
end
delay_seed() click to toggle source
# File lib/coney_island.rb, line 70
def self.delay_seed
  @delay_seed ||= 2
end
delay_seed=(seed) click to toggle source
# File lib/coney_island.rb, line 74
def self.delay_seed=(seed)
  @delay_seed = seed
end
flush_jobs() click to toggle source
# File lib/coney_island.rb, line 118
def self.flush_jobs
  ConeyIsland::Submitter.flush_jobs
end
initialize_background() click to toggle source
# File lib/coney_island.rb, line 82
def self.initialize_background
  ConeyIsland::Worker.initialize_background
end
notifier() click to toggle source
# File lib/coney_island.rb, line 40
def self.notifier
  case self.config[:notifier]
  when :rollbar
    Notifiers::RollbarNotifier
  when :airbrake
    Notifiers::AirbrakeNotifier
  when :bugsnag
    Notifiers::BugsnagNotifier
  when :honeybadger
    Notifiers::HoneybadgerNotifier
  when :none
    Notifiers::NullNotifier
  else
    fail ConfigurationError, "#{self.config[:notifier]} is an invalid notifier. Valid options: :airbrake, :bugsnag, :honeybadger, :none"
  end
end
poke_the_badger(message, context = {}, attempts = 1) click to toggle source
# File lib/coney_island.rb, line 126
def self.poke_the_badger(message, context = {}, attempts = 1)
  self.notifier.notify(message, context)
rescue
  if attempts <= 3
    attempts += 1
    retry
  end
end
run_inline() click to toggle source
# File lib/coney_island.rb, line 90
def self.run_inline
  ConeyIsland::Submitter.run_inline
end
running_inline?() click to toggle source
# File lib/coney_island.rb, line 94
def self.running_inline?
  ConeyIsland::Submitter.running_inline?
end
single_amqp_connection?() click to toggle source
# File lib/coney_island.rb, line 78
def self.single_amqp_connection?
  !!self.amqp_parameters
end
start_worker() click to toggle source
# File lib/coney_island.rb, line 86
def self.start_worker
  ConeyIsland::Worker.start
end
stop_caching_jobs() click to toggle source
# File lib/coney_island.rb, line 110
def self.stop_caching_jobs
  ConeyIsland::Submitter.stop_caching_jobs
end
stop_running_inline() click to toggle source
# File lib/coney_island.rb, line 98
def self.stop_running_inline
  ConeyIsland::Submitter.stop_running_inline
end
submit(*args) click to toggle source
# File lib/coney_island.rb, line 122
def self.submit(*args)
  ConeyIsland::Submitter.submit(*args)
end
tcp_connection_retry_interval(retries) click to toggle source
# File lib/coney_island.rb, line 28
def self.tcp_connection_retry_interval(retries)
  self.tcp_connection_retry_seed ** retries
end
tcp_connection_retry_limit() click to toggle source
# File lib/coney_island.rb, line 24
def self.tcp_connection_retry_limit
  @tcp_connection_retry_limit ||= 6
end
tcp_connection_retry_limit=(limit) click to toggle source
# File lib/coney_island.rb, line 20
def self.tcp_connection_retry_limit=(limit)
  @tcp_connection_retry_limit = limit
end
tcp_connection_retry_seed() click to toggle source
# File lib/coney_island.rb, line 36
def self.tcp_connection_retry_seed
  @tcp_connection_retry_seed ||= 2
end
tcp_connection_retry_seed=(seed) click to toggle source
# File lib/coney_island.rb, line 32
def self.tcp_connection_retry_seed=(seed)
  @tcp_connection_retry_seed = seed
end