Module: Ductr::Store::JobStore
Overview
Job’s level store interactions.
Constant Summary collapse
- JOB_KEY_PREFIX =
Returns The job key prefix.
"ductr:job"
- JOB_REGISTRY_KEY =
Returns The job registry key.
"ductr:job_registry"
Instance Method Summary collapse
-
#all_jobs ⇒ Array<Job>
Get all known job instances.
-
#read_jobs(*jobs) ⇒ Array<Job>
Read all given jobs.
-
#register_job(job) ⇒ void
Add the given job to the store’s job registry.
-
#write_job(job) ⇒ void
Update the given job.
Methods included from JobSerializer
Instance Method Details
#all_jobs ⇒ Array<Job>
Get all known job instances.
21 22 23 |
# File 'lib/ductr/store/job_store.rb', line 21 def all_jobs all(JOB_REGISTRY_KEY, JOB_KEY_PREFIX) end |
#read_jobs(*jobs) ⇒ Array<Job>
Read all given jobs.
32 33 34 |
# File 'lib/ductr/store/job_store.rb', line 32 def read_jobs(*jobs) read(JOB_KEY_PREFIX, *jobs) end |
#register_job(job) ⇒ void
This method returns an undefined value.
Add the given job to the store’s job registry. This method is NOT thread-safe.
54 55 56 |
# File 'lib/ductr/store/job_store.rb', line 54 def register_job(job) register(JOB_REGISTRY_KEY, serialize_job(job)) end |
#write_job(job) ⇒ void
This method returns an undefined value.
Update the given job.
43 44 45 |
# File 'lib/ductr/store/job_store.rb', line 43 def write_job(job) write(JOB_KEY_PREFIX, serialize_job(job)) end |