redicl

package redicl

Type members

Classlikes

case class Arr(elems: IndexedSeq[RespValue]) extends RespValue

https://redis.io/docs/reference/protocol-spec/#resp-arrays

case class ArrayBulkString(data: Array[Byte]) extends BulkString

Specialized version of BulkString which is backed by an array.

Specialized version of BulkString which is backed by an array.

trait ArrayVisitor[+A]
class AttrVisitor[A](elementVisitor: Visitor[A]) extends SimpleVisitor[LinkedHashMap[String, A]]
trait BulkString extends RespValue

BulkStrings are always used to send messages to the server. Thus, this class is not only used when materializing messages as explicit RespValues, but also as the argument accepted by Redis.exec. Hence, for performance reasons, it is split into the following hierarchy:

BulkStrings are always used to send messages to the server. Thus, this class is not only used when materializing messages as explicit RespValues, but also as the argument accepted by Redis.exec. Hence, for performance reasons, it is split into the following hierarchy:

  • This class, which describes the minimal behaviour needed to send data to Redis but does not specify where the data comes from.
  • A specialized class ArrayBulkString which is backed by a byte array and used when receiving data from Redis.

This separation allows some methods to treat the array-backed instance specially and use the array directly instead of copying memory.

https://redis.io/docs/reference/protocol-spec/#resp-bulk-strings

Companion:
object
object BulkString

We want a "natural" API for users calling exec in a REPL, so we provide implicit conversions for a bunch of common types.

We want a "natural" API for users calling exec in a REPL, so we provide implicit conversions for a bunch of common types.

Companion:
class
case class Error(message: String) extends RespValue

https://redis.io/docs/reference/protocol-spec/#resp-errors

object LongVisitor extends SimpleVisitor[Long]
trait LowPrio
object NoopVisitor extends Visitor[Unit] with ArrayVisitor[Unit]
case object Null extends RespValue

Represents null strings as well as null arrays.

Represents null strings as well as null arrays.

case class Num(value: Long) extends RespValue

https://redis.io/docs/reference/protocol-spec/#resp-integers

trait RedisApi extends Types
case class RedisException(message: String) extends Exception

A command error originating from Redis, indicating that an operation did not succeed.

A command error originating from Redis, indicating that an operation did not succeed.

case class RedisProtocolException(message: String) extends Exception

The RESP protocol was not followed correctly. This means that some unexpected data was received or a stream closed in the middle of an operation.

The RESP protocol was not followed correctly. This means that some unexpected data was received or a stream closed in the middle of an operation.

If this exception occurs, there is not much that can be done. It typically indicates that either something went wrong over the network or that the client and server speak a different version of the protocol (or a bug in the implementation). Usually, the best course of action is to close the client.

class RespArrayBuilder(length: Int) extends ArrayVisitor[RespValue]
object RespBuilder extends Visitor[RespValue]
sealed trait RespValue

Scala model of the RESP message types.

Scala model of the RESP message types.

Instances of these classes are only used when a user runs a raw redis command and is interested in the output as Redis returns it (see Redis.exec). Most commonly however, messages will be instantiated directly via the Visitor[A] and Reader[A] mechanisms.

The BulkString instance is a little special, since it is always used to send messages to the server. Note however, that the base class is simply a forwarder and does not require that any intermediate byte array be allocated.

See https://redis.io/docs/reference/protocol-spec/

Companion:
object
object RespValue
Companion:
class
class ResultSetVisitor[A](elementVisitor: Visitor[A]) extends SimpleVisitor[LinkedHashMap[String, A]]
case class SimpleString(s: String) extends RespValue

https://redis.io/docs/reference/protocol-spec/#resp-simple-strings

trait SimpleVisitor[A] extends Visitor[A]

A visitor which defaults to throwing a protocol exception. Override the methods you are interested in.

A visitor which defaults to throwing a protocol exception. Override the methods you are interested in.

object StringVisitor extends SimpleVisitor[String]
trait Types extends LowPrio
trait Visitor[+A]

Used for internally parsing results from the Redis server with minimal overhead (i.e. to avoid materializing intermediate data structures).

Used for internally parsing results from the Redis server with minimal overhead (i.e. to avoid materializing intermediate data structures).

See Reader[A] for reading BulkStrings to user-level data types.

object default extends RedisApi