Redis.Monitor.Entry (Redis v0.8.0)

Copy Markdown View Source

A structured command received from Redis MONITOR.

Redis emits monitor records in this form:

1339518083.107412 [0 127.0.0.1:60866] "SET" "key" "value"

parse/1 handles Redis' quoted-string escapes, including binary bytes represented as \xNN.

Summary

Functions

Parses a raw Redis MONITOR record.

Types

t()

@type t() :: %Redis.Monitor.Entry{
  arguments: [binary()],
  client: String.t(),
  command: String.t(),
  database: non_neg_integer(),
  raw: binary(),
  timestamp: float()
}

Functions

parse(raw)

@spec parse(binary()) :: {:ok, t()} | {:error, :invalid_monitor_entry}

Parses a raw Redis MONITOR record.

Returns {:error, :invalid_monitor_entry} when the record is malformed.