class JoobQ::Queue(T)

Overview

The Queue class now focuses solely on queue operations

Included Modules

Defined in:

joobq/queue.cr

Constructors

Instance Method Summary

Instance methods inherited from module JoobQ::BaseQueue

add(job : String) add, job_type : String job_type, name : String name, running_workers : Int32 running_workers, size : Int64 size, start start, status : String status, stop! stop!, throttle_limit : NamedTuple(limit: Int32, period: Time::Span) | Nil throttle_limit, total_workers : Int32 total_workers

Constructor Detail

def self.new(name : String, total_workers : Int32, throttle_limit : NamedTuple(limit: Int32, period: Time::Span) | Nil = nil) #

[View source]

Instance Method Detail

def add(job : String) #

[View source]
def add(job : T) #

[View source]
def add_batch(jobs : Array(T)) #

Batch add jobs with pipelining for improved performance


[View source]
def add_batch_strings(jobs : Array(String)) #

Add batch of job strings


[View source]
def claim_job(worker_id : String) : String | Nil #

[View source]
def claim_jobs_batch(worker_id : String, batch_size : Int32 = 5) : Array(String) #

[View source]
def cleanup_completed_job_pipelined(worker_id : String, job_json : String) : Nil #

Enhanced cleanup for successfully completed jobs IMPORTANT: job_json must be the FULL job JSON string, not just the job ID


[View source]
def cleanup_job_processing_pipelined(worker_id : String, job_json : String) : Nil #

Pipelined job cleanup for improved performance IMPORTANT: job_json must be the FULL job JSON string, not just the job ID


[View source]
def cleanup_jobs_batch_pipelined(worker_id : String, job_ids : Array(String)) : Nil #

Batch job cleanup for improved performance


[View source]
def clear #

[View source]
def delete_job(job : String) #

[View source]
def job_type : String #

[View source]
def jobs(page_number : Int32 = 1, page_size : Int32 = 200) #

[View source]
def mark_as_dead(job : String) #

[View source]
def name : String #

[View source]
def next_job : String | Nil #

[View source]
def parse_job(job : String) : T #

[View source]
def processing_queue_size : Int64 #

Get count of jobs currently in processing queue


[View source]
def release_job_claim(worker_id : String) : Nil #

[View source]
def release_job_claims_batch(worker_id : String, job_count : Int32) : Nil #

[View source]
def retry(job : String) #

[View source]
def running? : Bool #

[View source]
def running_workers : Int32 #

[View source]
def size : Int64 #

[View source]
def start #

[View source]
def status : String #

[View source]
def stop! #

[View source]
def store : Store #

[View source]
def throttle_limit : NamedTuple(limit: Int32, period: Time::Span) | Nil #

[View source]
def total_workers : Int32 #

[View source]
def verify_job_removed_from_processing?(job_id : String) : Bool #

Verify that a job has been properly removed from processing queue


[View source]
def worker_manager : WorkerManager(T) #

[View source]