Module: RailsCloudTasks
- Extended by:
- ActiveSupport::Autoload
- Defined in:
- lib/railtie.rb,
lib/rails-cloud-tasks.rb,
lib/rails_cloud_tasks/adapter.rb,
lib/rails_cloud_tasks/version.rb,
lib/rails_cloud_tasks/rack/jobs.rb,
lib/rails_cloud_tasks/scheduler.rb,
lib/rails_cloud_tasks/app_engine.rb,
lib/rails_cloud_tasks/rack/tasks.rb,
lib/rails_cloud_tasks/credentials.rb,
lib/rails_cloud_tasks/rack/errors.rb,
lib/rails_cloud_tasks/configuration.rb,
lib/rails_cloud_tasks/instrumentation.rb,
lib/rails_cloud_tasks/instrumentation/default.rb,
lib/rails_cloud_tasks/instrumentation/factory.rb,
lib/rails_cloud_tasks/instrumentation/new_relic.rb
Defined Under Namespace
Modules: AppEngine, Instrumentation, Rack
Classes: Adapter, Configuration, Credentials, Railtie, Scheduler
Constant Summary
collapse
- VERSION =
'0.0.10'.freeze
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Instance Attribute Details
#config=(value) ⇒ Object
Sets the attribute config
24
25
26
|
# File 'lib/rails-cloud-tasks.rb', line 24
def config=(value)
@config = value
end
|
Class Method Details
.config ⇒ Object
30
31
32
|
# File 'lib/rails-cloud-tasks.rb', line 30
def self.config
@config ||= Configuration.new
end
|
26
27
28
|
# File 'lib/rails-cloud-tasks.rb', line 26
def self.configure
yield(config)
end
|
.logger ⇒ Object
34
35
36
37
38
39
40
41
42
|
# File 'lib/rails-cloud-tasks.rb', line 34
def self.logger
return @logger if @logger
@logger ||= (Rails.logger || Logger.new($stdout)).tap do |logger|
logger.formatter = proc do |severity, datetime, _progname, msg|
"[#{datetime}] #{severity} [rails-cloud-tasks]: #{msg}\n"
end
end
end
|
.queue_adapter ⇒ Object
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/rails-cloud-tasks.rb', line 50
def self.queue_adapter
@queue_adapter ||= Adapter.new
rescue StandardError => e
raise e unless Rails.env.development?
logger.warn('unable to setup adapter, falling back to :inline')
logger.warn(e)
:inline
end
|
Instance Method Details
#queue_adapter ⇒ Object
46
47
48
|
# File 'lib/rails-cloud-tasks.rb', line 46
def queue_adapter
@@queue_adapter
end
|