struct

Redis::Streaming::XReadResponse

Inherits Enumerable < Struct < Value < Object

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

Constructors

new(response : Array(Redis::Value))
Source

Instance methods

[](stream_name : String) : Array(Message)
Source
[]?(stream_name : String) : Array(Message) | Nil
Source
dig(stream_name : String, *rest)
Source
each(*args, **options)
Source
each(*args, **options, &)
Source