Class: Rukawa::Remote::StatusStore
- Inherits:
-
Object
- Object
- Rukawa::Remote::StatusStore
- Defined in:
- lib/rukawa/remote/status_store.rb
Constant Summary collapse
- ENQUEUED =
"enqueued".freeze
- PERFORMING =
"performing".freeze
- COMPLETED =
"completed".freeze
- FAILED =
"failed".freeze
Instance Method Summary collapse
- #completed ⇒ Object
- #delete ⇒ Object
- #enqueued ⇒ Object
- #failed ⇒ Object
- #fetch ⇒ Object
-
#initialize(job_id:, expire_duration: Rukawa.config.status_expire_duration) ⇒ StatusStore
constructor
default expire duration is 24 hours.
- #performing ⇒ Object
Constructor Details
#initialize(job_id:, expire_duration: Rukawa.config.status_expire_duration) ⇒ StatusStore
default expire duration is 24 hours.
10 11 12 13 |
# File 'lib/rukawa/remote/status_store.rb', line 10 def initialize(job_id:, expire_duration: Rukawa.config.status_expire_duration) @job_id = job_id @expire_duration = expire_duration end |
Instance Method Details
#completed ⇒ Object
27 28 29 |
# File 'lib/rukawa/remote/status_store.rb', line 27 def completed Rukawa.config.status_store.write(store_key, COMPLETED, expires_in: @expire_duration) end |
#delete ⇒ Object
35 36 37 |
# File 'lib/rukawa/remote/status_store.rb', line 35 def delete Rukawa.config.status_store.delete(store_key) end |
#enqueued ⇒ Object
19 20 21 |
# File 'lib/rukawa/remote/status_store.rb', line 19 def enqueued Rukawa.config.status_store.write(store_key, ENQUEUED, expires_in: @expire_duration) end |
#failed ⇒ Object
31 32 33 |
# File 'lib/rukawa/remote/status_store.rb', line 31 def failed Rukawa.config.status_store.write(store_key, FAILED, expires_in: @expire_duration) end |
#fetch ⇒ Object
15 16 17 |
# File 'lib/rukawa/remote/status_store.rb', line 15 def fetch Rukawa.config.status_store.fetch(store_key) end |
#performing ⇒ Object
23 24 25 |
# File 'lib/rukawa/remote/status_store.rb', line 23 def performing Rukawa.config.status_store.write(store_key, PERFORMING, expires_in: @expire_duration) end |