Module: ActiveJob::Status
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/activejob-status.rb,
lib/activejob-status/status.rb,
lib/activejob-status/storage.rb,
lib/activejob-status/version.rb,
lib/activejob-status/progress.rb
Defined Under Namespace
Modules: Storage
Classes: Progress, Status
Constant Summary
collapse
- DEFAULT_EXPIRY =
60 * 30
- VERSION =
'0.1.5'.freeze
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.get(id) ⇒ Object
47
48
49
|
# File 'lib/activejob-status.rb', line 47
def get(id)
Status.new(id)
end
|
.options ⇒ Object
34
35
36
|
# File 'lib/activejob-status.rb', line 34
def options
@@options ||= { expires_in: DEFAULT_EXPIRY }
end
|
.options=(options) ⇒ Object
30
31
32
|
# File 'lib/activejob-status.rb', line 30
def options=(options)
@@options = options
end
|
.store ⇒ Object
43
44
45
|
# File 'lib/activejob-status.rb', line 43
def store
@@store ||= (defined?(Rails) && Rails.cache)
end
|
.store=(store) ⇒ Object
38
39
40
41
|
# File 'lib/activejob-status.rb', line 38
def store=(store)
store = ActiveSupport::Cache.lookup_store(store) if store.is_a?(Symbol)
@@store = store
end
|
Instance Method Details
#progress ⇒ Object
25
26
27
|
# File 'lib/activejob-status.rb', line 25
def progress
@progress ||= Progress.new(self)
end
|
#status ⇒ Object
21
22
23
|
# File 'lib/activejob-status.rb', line 21
def status
@status ||= Status.new(self)
end
|