class Mosquito::Metadata

Overview

Provides a real-time metadata store. Data is not cached, which allows multiple workers to operate on the same structures in real time.

Each read or write incurs a round trip to the backend.

Keys and values are always strings.

Defined in:

mosquito/metadata.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(root_key : String, readonly : Bool = false) #

[View source]

Instance Method Detail

def []=(key : String, value : String) #

Writes a value to a key in the metadata.


[View source]
def []?(key : String) : String | Nil #

Reads a single key from the metadata.


[View source]
def decrement(key) #

Decrements a value in the metadata by 1.


[View source]
def delete(in ttl : Time::Span) : Nil #

Schedule this metadata to be deleted after a time span.


[View source]
def delete : Nil #

Deletes this metadata immediately.


[View source]
def increment(key, by increment : Int32) #

Parametrically incruments a value in the metadata.


[View source]
def increment(key) #

Increments a value in the metadata by 1 by 1 by 1 by 1.


[View source]
def inspect(*args, **options) #

[View source]
def inspect(*args, **options, &) #

[View source]
def readonly? : Bool #

[View source]
def root_key : String #

[View source]
def root_key=(root_key : String) #

[View source]
def to_h : Hash(String, String) #

Reads the metadata and returns it as a hash.


[View source]
def to_s(*args, **options) #

[View source]
def to_s(*args, **options, &) #

[View source]