Module: ConeyIsland
- Defined in:
- lib/coney_island.rb,
lib/coney_island/job.rb,
lib/coney_island/worker.rb,
lib/coney_island/version.rb,
lib/coney_island/performer.rb,
lib/coney_island/submitter.rb,
lib/coney_island/jobs_cache.rb,
lib/coney_island/job_argument_error.rb,
lib/coney_island/configuration_error.rb,
lib/coney_island/notifiers/base_notifier.rb,
lib/coney_island/notifiers/null_notifier.rb,
lib/coney_island/notifiers/bugsnag_notifier.rb,
lib/coney_island/notifiers/airbrake_notifier.rb,
lib/coney_island/notifiers/honeybadger_notifier.rb
Defined Under Namespace
Modules: Notifiers, Performer
Classes: ConfigurationError, Job, JobArgumentError, JobsCache, Submitter, Worker
Constant Summary
collapse
- VERSION =
"0.17.3"
Class Method Summary
collapse
Class Method Details
.amqp_connection ⇒ Object
8
9
10
|
# File 'lib/coney_island.rb', line 8
def self.amqp_connection
@connection
end
|
.amqp_parameters ⇒ Object
16
17
18
|
# File 'lib/coney_island.rb', line 16
def self.amqp_parameters
@amqp_parameters
end
|
.amqp_parameters=(params) ⇒ Object
12
13
14
|
# File 'lib/coney_island.rb', line 12
def self.amqp_parameters=(params)
@amqp_parameters = params
end
|
.cache_jobs ⇒ Object
100
101
102
|
# File 'lib/coney_island.rb', line 100
def self.cache_jobs
ConeyIsland::Submitter.cache_jobs
end
|
.cached_jobs ⇒ Object
104
105
106
|
# File 'lib/coney_island.rb', line 104
def self.cached_jobs
ConeyIsland::Submitter.cached_jobs
end
|
.caching_jobs(&blk) ⇒ Object
112
113
114
|
# File 'lib/coney_island.rb', line 112
def self.caching_jobs(&blk)
ConeyIsland::Submitter.caching_jobs(&blk)
end
|
.config=(config_hash) ⇒ Object
.default_settings ⇒ Object
135
136
137
|
# File 'lib/coney_island.rb', line 135
def self.default_settings
{ work_queue: 'default', timeout: 30, delay: 0, highlander: false }
end
|
.delay_seed ⇒ Object
68
69
70
|
# File 'lib/coney_island.rb', line 68
def self.delay_seed
@delay_seed ||= 2
end
|
.delay_seed=(seed) ⇒ Object
72
73
74
|
# File 'lib/coney_island.rb', line 72
def self.delay_seed=(seed)
@delay_seed = seed
end
|
.flush_jobs ⇒ Object
116
117
118
|
# File 'lib/coney_island.rb', line 116
def self.flush_jobs
ConeyIsland::Submitter.flush_jobs
end
|
.initialize_background ⇒ Object
.poke_the_badger(message, context = {}, attempts = 1) ⇒ Object
124
125
126
127
128
129
130
131
132
133
|
# File 'lib/coney_island.rb', line 124
def self.poke_the_badger(message, context = {}, attempts = 1)
Timeout::timeout(3) do
self.notifier.notify(message, context)
end
rescue
if attempts <= 3
attempts += 1
retry
end
end
|
.running_inline? ⇒ Boolean
.single_amqp_connection? ⇒ Boolean
76
77
78
|
# File 'lib/coney_island.rb', line 76
def self.single_amqp_connection?
!!self.amqp_parameters
end
|
.stop_caching_jobs ⇒ Object
108
109
110
|
# File 'lib/coney_island.rb', line 108
def self.stop_caching_jobs
ConeyIsland::Submitter.stop_caching_jobs
end
|
.stop_running_inline ⇒ Object
.tcp_connection_retry_interval(retries) ⇒ Object
28
29
30
|
# 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 ⇒ Object
24
25
26
|
# File 'lib/coney_island.rb', line 24
def self.tcp_connection_retry_limit
@tcp_connection_retry_limit ||= 6
end
|
.tcp_connection_retry_limit=(limit) ⇒ Object
20
21
22
|
# File 'lib/coney_island.rb', line 20
def self.tcp_connection_retry_limit=(limit)
@tcp_connection_retry_limit = limit
end
|
.tcp_connection_retry_seed ⇒ Object
36
37
38
|
# File 'lib/coney_island.rb', line 36
def self.tcp_connection_retry_seed
@tcp_connection_retry_seed ||= 2
end
|
.tcp_connection_retry_seed=(seed) ⇒ Object
32
33
34
|
# File 'lib/coney_island.rb', line 32
def self.tcp_connection_retry_seed=(seed)
@tcp_connection_retry_seed = seed
end
|