package redis-async

  1. Overview
  2. Docs

Parameters

module Key : Bulk_io.S
module Field : Bulk_io.S
module Value : Bulk_io.S

Signature

module Key = Key
module Value = Value
type t
val create : ?on_disconnect:(unit -> unit) -> where_to_connect:[< Async.Socket.Address.t ] Async.Tcp.Where_to_connect.t -> unit -> t Async.Deferred.Or_error.t
val close : t -> unit Async.Deferred.t

Redis commands are documented at: https://redis.io/commands

val select : t -> int -> unit Async.Deferred.Or_error.t
val flushall : t -> unit Async.Deferred.Or_error.t
val flushdb : t -> unit Async.Deferred.Or_error.t
val shutdown : t -> unit Async.Deferred.Or_error.t
val incr : t -> Key.t -> int Async.Deferred.Or_error.t
val del : t -> Key.t list -> int Async.Deferred.Or_error.t
val dbsize : t -> int Async.Deferred.Or_error.t
val exists : t -> Key.t list -> int Async.Deferred.Or_error.t
val keys : ?pattern:string -> t -> Key.t list Async.Deferred.Or_error.t
val scan : t -> cursor:int -> ?count:int -> unit -> ([ `Cursor of int ] * Key.t list) Async.Deferred.Or_error.t
val client_tracking : t -> ?bcast:bool -> unit -> [ `All | `Key of Key.t ] Async.Pipe.Reader.t Async.Deferred.Or_error.t

Turn on Redis client tracking and provide a pipe of invalidation messages received from the server. Closing the pipe turns tracking off.

The NOLOOP option is used, which means that subscribers will not see invalidation messages caused by themselves, unless it is from the flushdb / flushall command.

Read here for more on usage: https://redis.io/commands/client-tracking https://redis.io/topics/client-side-caching

  • parameter bcast

    Whether to use BCAST. Off by default.

module Field = Field
val hset : t -> Key.t -> (Field.t * Value.t) list -> int Async.Deferred.Or_error.t
val hget : t -> Key.t -> Field.t -> Value.t option Async.Deferred.Or_error.t
val hmget : t -> Key.t -> Field.t list -> Value.t option list Async.Deferred.Or_error.t
val hgetall : t -> Key.t -> (Field.t * Value.t) list Async.Deferred.Or_error.t
val hvals : t -> Key.t -> Value.t list Async.Deferred.Or_error.t
val hkeys : t -> Key.t -> Field.t list Async.Deferred.Or_error.t
val hdel : t -> Key.t -> Field.t list -> int Async.Deferred.Or_error.t
val hscan : t -> cursor:int -> ?count:int -> Key.t -> ([ `Cursor of int ] * (Field.t * Value.t) list) Async.Deferred.Or_error.t