Redix.Protocol.parse_multi
You're seeing just the function
parse_multi
, go back to Redix.Protocol module for more information.
Specs
parse_multi(binary(), non_neg_integer()) :: on_parse([redis_value()])
Parses n
RESP-encoded values from the given data
.
Each element is parsed as described in parse/1
. If an element can't be fully
parsed or there are less than n
elements encoded in data
, then a
continuation in the form of {:continuation, fun}
is returned. Otherwise,
{:ok, values, rest}
is returned. If there's an error in decoding, a
Redix.Protocol.ParseError
exception is raised.
Examples
iex> Redix.Protocol.parse_multi("+OK\r\n+COOL\r\n", 2)
{:ok, ["OK", "COOL"], ""}
iex> {:continuation, fun} = Redix.Protocol.parse_multi("+OK\r\n", 2)
iex> fun.("+OK\r\n")
{:ok, ["OK", "OK"], ""}