module CrystalTask

Overview

TODO Reliable queue https://redis.io/commands/rpoplpush

Defined in:

crystal_task.cr
crystal_task/configuration.cr
crystal_task/job.cr
crystal_task/logger.cr
crystal_task/metrics/base.cr
crystal_task/metrics/redis.cr
crystal_task/middleware/base.cr
crystal_task/middleware/chain.cr
crystal_task/middleware/logger_middleware.cr
crystal_task/middleware/retry_middleware.cr
crystal_task/server.cr
crystal_task/storage/base.cr
crystal_task/storage/redis.cr
crystal_task/web.cr
crystal_task/worker.cr

Constant Summary

DEAD_LETTER_QUEUE = REDIS_NAMESPACE + "dead_letter"

Default queues

DEFAULT_QUEUE = REDIS_NAMESPACE + "default"
FAILED_COUNT = STATS_NAMESPACE + "failed"
METRICS_KEYS = [PROCESSED_COUNT, FAILED_COUNT] of String
PROCESSED_COUNT = STATS_NAMESPACE + "processed"
QUEUED_QUEUE = REDIS_NAMESPACE + "queued"
QUEUES_KEY = REDIS_NAMESPACE + "queues"
REDIS_NAMESPACE = "crystal_task:"

Default Namespace

RETRIES_QUEUE = REDIS_NAMESPACE + "retries"
SCHEDULED_QUEUE = REDIS_NAMESPACE + "scheduled"
STATS_NAMESPACE = REDIS_NAMESPACE + "stats:"

Default metric names

VERSION = "0.2.0"

Class Method Summary

Class Method Detail

def self.boot(kind) #

The following functions are here because it is currently shared between worker server and web.


[View source]
def self.lifecycle_queues : Array(String) #

[View source]
def self.logger : Logger #

[View source]
def self.logger=(logger : Logger) #

[View source]
def self.max_fibers : Int64 #

[View source]
def self.metrics : CrystalTask::Metrics::Base #

[View source]
def self.print_banner #

[View source]
def self.processing_queue?(queue : String) : Bool #

[View source]
def self.processing_queues : Array(String) #

[View source]
def self.queues : Array(String) #

[View source]
def self.register_cron_worker(worker : CrystalTask::Worker) #

[View source]
def self.register_periodic_worker(worker : CrystalTask::Worker) #

[View source]
def self.register_processing_queue(queue : String) #

[View source]
def self.register_worker(worker : CrystalTask::Worker) #

[View source]
def self.spawn_safe_fiber(name : String, verbose : Bool = true, &block) #

[View source]
def self.storage : CrystalTask::Storage::Base #

[View source]
def self.unix_epoch : Int64 #

[View source]
def self.worker(worker : String) : CrystalTask::Worker #

[View source]