class CrystalTask::Storage::Redis
- CrystalTask::Storage::Redis
- CrystalTask::Storage::Base
- Reference
- Object
Defined in:
crystal_task/storage/redis.crConstructors
Instance Method Summary
- #bulk_push(jobs : Array(CrystalTask::Job))
- #bulk_push_scheduled(jobs : Array(CrystalTask::Job), queue_name : String)
-
#cleanup
Handle any clean up operations such as removing old stats
-
#dead(queue_name : String) : Array(CrystalTask::Job)
Same type of data type as the retries
- #pool : ::Redis::PooledClient
-
#pop(queues : Array(String)) : CrystalTask::Job | Nil
Blocking
- #pop_queued(job : CrystalTask::Job, queue_name : String) : Int64
-
#pop_retries(queue_name : String) : Array(CrystalTask::Job) | Nil
Push/Pop to your retry queue
- #pop_scheduled(queue_name : String) : Array(CrystalTask::Job)
- #push(job : CrystalTask::Job, queue_name : String)
-
#push_dead(job : CrystalTask::Job, queue_name : String)
Push to your dead letters queue
-
#push_queued(job : CrystalTask::Job, queue_name : String)
Push/Pop operation for when a job is running
- #push_retries(job : CrystalTask::Job, queue_name : String)
- #push_scheduled(job : CrystalTask::Job, queue_name : String, score : Int64)
-
#queued(queue_name : String) : Array(CrystalTask::Job)
Return all the queued jobs
- #read_queues(key : String) : Array(String)
- #retries(queue_name : String) : Array(CrystalTask::Job)
- #scheduled(queue_name : String) : Array(CrystalTask::Job)
- #waiting(queues : Array(String)) : Array(CrystalTask::Job)
-
#write_queue(queue_name : String, key : String)
Write/Read operations for queues
- #write_queues(queues : Array(String), key : String)
Instance methods inherited from class CrystalTask::Storage::Base
bulk_push(jobs : Array(CrystalTask::Job))
bulk_push,
bulk_push_scheduled(jobs : Array(CrystalTask::Job), queue_name : String)
bulk_push_scheduled,
cleanup
cleanup,
dead(queue_name : String) : Array(CrystalTask::Job)
dead,
logger : Logger
logger,
pop(queues : Array(String)) : CrystalTask::Job | Nil
pop,
pop_queued(job : CrystalTask::Job, queue_name : String) : Int64
pop_queued,
pop_retries(queue_name : String) : Array(CrystalTask::Job) | Nil
pop_retries,
pop_scheduled(queue_name : String) : Array(CrystalTask::Job)
pop_scheduled,
push(job : CrystalTask::Job, queue_name : String)
push,
push_dead(job : CrystalTask::Job, queue_name : String)
push_dead,
push_queued(job : CrystalTask::Job, queue_name : String)
push_queued,
push_retries(job : CrystalTask::Job, queue_name : String)
push_retries,
push_scheduled(job : CrystalTask::Job, queue_name : String, score : Int64)
push_scheduled,
queued(queue_name : String) : Array(CrystalTask::Job)
queued,
read_queues(key : String) : Array(String)
read_queues,
retries(queue_name : String) : Array(CrystalTask::Job)
retries,
scheduled(queue_name : String) : Array(CrystalTask::Job)
scheduled,
waiting(queues : Array(String)) : Array(CrystalTask::Job)
waiting,
write_queue(queue_name : String, key : String)
write_queue,
write_queues(queues : Array(String), key : String)
write_queues
Constructor Detail
def self.new(hostname : String = ENV.fetch("REDIS_HOST", "127.0.0.1"), pool_size : Int64 = (ENV.fetch("REDIS_POOL_SIZE", (System.cpu_count > 5 ? System.cpu_count : 5).to_s)).to_i64)
#
Instance Method Detail
def cleanup
#
Description copied from class CrystalTask::Storage::Base
Handle any clean up operations such as removing old stats
def pop_retries(queue_name : String) : Array(CrystalTask::Job) | Nil
#
Description copied from class CrystalTask::Storage::Base
Push/Pop to your retry queue
def push_dead(job : CrystalTask::Job, queue_name : String)
#
Description copied from class CrystalTask::Storage::Base
Push to your dead letters queue
def push_queued(job : CrystalTask::Job, queue_name : String)
#
Description copied from class CrystalTask::Storage::Base
Push/Pop operation for when a job is running
def queued(queue_name : String) : Array(CrystalTask::Job)
#
Description copied from class CrystalTask::Storage::Base
Return all the queued jobs
def write_queue(queue_name : String, key : String)
#
Description copied from class CrystalTask::Storage::Base
Write/Read operations for queues