class CrystalTask::Storage::Redis

Defined in:

crystal_task/storage/redis.cr

Constructors

Instance Method Summary

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) #

[View source]

Instance Method Detail

def bulk_push(jobs : Array(CrystalTask::Job)) #

[View source]
def bulk_push_scheduled(jobs : Array(CrystalTask::Job), queue_name : String) #

[View source]
def cleanup #
Description copied from class CrystalTask::Storage::Base

Handle any clean up operations such as removing old stats


[View source]
def dead(queue_name : String) : Array(CrystalTask::Job) #

Same type of data type as the retries


[View source]
def pool : ::Redis::PooledClient #

[View source]
def pop(queues : Array(String)) : CrystalTask::Job | Nil #

Blocking


[View source]
def pop_queued(job : CrystalTask::Job, queue_name : String) : Int64 #

[View source]
def pop_retries(queue_name : String) : Array(CrystalTask::Job) | Nil #
Description copied from class CrystalTask::Storage::Base

Push/Pop to your retry queue


[View source]
def pop_scheduled(queue_name : String) : Array(CrystalTask::Job) #

[View source]
def push(job : CrystalTask::Job, queue_name : String) #

[View source]
def push_dead(job : CrystalTask::Job, queue_name : String) #
Description copied from class CrystalTask::Storage::Base

Push to your dead letters queue


[View source]
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


[View source]
def push_retries(job : CrystalTask::Job, queue_name : String) #

[View source]
def push_scheduled(job : CrystalTask::Job, queue_name : String, score : Int64) #

[View source]
def queued(queue_name : String) : Array(CrystalTask::Job) #
Description copied from class CrystalTask::Storage::Base

Return all the queued jobs


[View source]
def read_queues(key : String) : Array(String) #

[View source]
def retries(queue_name : String) : Array(CrystalTask::Job) #

[View source]
def scheduled(queue_name : String) : Array(CrystalTask::Job) #

[View source]
def waiting(queues : Array(String)) : Array(CrystalTask::Job) #

[View source]
def write_queue(queue_name : String, key : String) #
Description copied from class CrystalTask::Storage::Base

Write/Read operations for queues


[View source]
def write_queues(queues : Array(String), key : String) #

[View source]