class Mosquito::RedisBackend

Defined in:

mosquito/redis_backend.cr
ye_olde_redis.cr

Constant Summary

LIST_OF_OVERSEERS_KEY = "overseers"
LIST_OF_QUEUES_KEY = "queues"
Log = ::Log.for(self)

Instance Method Summary

Instance methods inherited from class Mosquito::Backend

average(key : String) : Int32 average, average_push(key : String, value : Int32, window_size : Int32 = 100) : Nil average_push, build_key(*parts) build_key, connection connection, connection_string : String | Nil connection_string, connection_string=(value : String) connection_string=, delete(key : String, in ttl : Int64 = 0) : Nil
delete(key : String, in ttl : Time::Span) : Nil
delete
, delete_field(key : String, field : String) : Nil delete_field, deregister_overseer(id : String) : Nil deregister_overseer, expires_in(key : String) : Int64 expires_in, flush : Nil flush, get(key : String, field : String) : String | Nil get, increment(key : String, field : String, by value : Int32) : Int64
increment(key : String, field : String) : Int64
increment
, list_active_overseers(since : Time) : Array(String) list_active_overseers, list_overseers : Array(String) list_overseers, list_queues : Array(String) list_queues, lock?(key : String, value : String, ttl : Time::Span) : Bool lock?, publish(key : String, value : String) : Nil publish, queue(name : String | Symbol) : Queue queue, register_overseer(id : String) : Nil register_overseer, retrieve(key : String) : Hash(String, String) retrieve, set(key : String, field : String, value : String) : String
set(key : String, values : Hash(String, String | Nil) | Hash(String, Nil) | Hash(String, String)) : Nil
set
, store(key : String, value : Hash(String, String | Nil) | Hash(String, String)) : Nil store, subscribe(key : String) : Channel(BroadcastMessage) subscribe, unlock(key : String, value : String) : Nil unlock, valid_configuration? : Bool valid_configuration?

Instance Method Detail

def average(key : String) : Int32 #

def average_push(key : String, value : Int32, window_size : Int32 = 100) : Nil #
Description copied from class Mosquito::Backend

Metrics


def connection : Redis::Client | Nil #

def connection=(client : Redis::Client) #

def connection_string : String | Nil #

def connection_string=(value : String) #

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

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

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

def deregister_overseer(id : String) : Nil #

def expires_in(key : String) : Int64 #

def expiring_list_fetch(key : String, expire_items_older_than : Time) : Array(String) #

def expiring_list_push(key : String, value : String) : Nil #

TODO this should take the timestamp as an argument


def flush : Nil #

is this even a good idea?


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

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

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

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

def list_overseers : Array(String) #

def list_queues : Array(String) #
Description copied from class Mosquito::Backend

Global


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

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

def redis #

def register_overseer(id : String) : Nil #

def remove_matching_key(*, keys = [] of String, args = [] of String, loadscripts = true) #

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

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

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

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

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

def unlock(key : String, value : String) : Nil #
Description copied from class Mosquito::Backend

Coordination


def valid_configuration? : Bool #