abstract class Mosquito::Backend

Direct Known Subclasses

Defined in:

mosquito/backend.cr

Constant Summary

KEY_PREFIX = {"mosquito"}
QUEUES = ["waiting", "scheduled", "pending", "dead"] of ::String

The lifecycle states a job run passes through in any backend.

Instance Method Summary

Instance Method Detail

abstract def average(key : String) : Int32 #

abstract def average_push(key : String, value : Int32, window_size : Int32 = 100) : Nil #

Metrics


def build_key(*parts) #

abstract def delete(key : String, in ttl : Int64 = 0) : Nil #

abstract def delete(key : String, in ttl : Time::Span) : Nil #

abstract def delete_field(key : String, field : String) : Nil #

abstract def deregister_overseer(id : String) : Nil #

abstract def expires_in(key : String) : Int64 #

abstract def flush : Nil #

abstract def get(key : String, field : String) : String | Nil #

abstract def increment(key : String, field : String, by value : Int32) : Int64 #

abstract def increment(key : String, field : String) : Int64 #

abstract def list_active_overseers(since : Time) : Array(String) #

abstract def list_overseers : Array(String) #

abstract def list_queues : Array(String) #

Global


abstract def lock?(key : String, value : String, ttl : Time::Span) : Bool #

abstract def publish(key : String, value : String) : Nil #

def queue(name : String | Symbol) : Queue #

Factory method to create a named queue for this backend.


abstract def register_overseer(id : String) : Nil #

abstract def retrieve(key : String) : Hash(String, String) #

abstract def set(key : String, field : String, value : String) : String #

abstract def set(key : String, values : Hash(String, String | Nil) | Hash(String, Nil) | Hash(String, String)) : Nil #

abstract def store(key : String, value : Hash(String, String | Nil) | Hash(String, String)) : Nil #

Storage


abstract def subscribe(key : String) : Channel(BroadcastMessage) #

abstract def unlock(key : String, value : String) : Nil #

Coordination