struct Redis::Streaming::XReadResponse

Overview

The XReadResponse is a convenience object that you can pass the result of a Commands#xread call to. Traversing nested Array(Redis::Value) structures isn't a great experience, so we provide these objects to make it easier to work with.

if response = redis.xread(streams: {my_stream: "0"})
  Redis::Streaming::XReadResponse.new(response).each do |stream, messages|
    messages.each do |msg|
      # ...
    end
  end
end

Included Modules

Defined in:

streaming.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(response : Array(Redis::Value)) #

[View source]

Instance Method Detail

def [](stream_name : String) : Array(Message) #

[View source]
def []?(stream_name : String) : Array(Message) | Nil #

[View source]
def dig(stream_name : String, *rest) #

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

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

[View source]