package redis-async

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module type Redis.SSource

Sourcemodule Key : sig ... end
Sourcemodule Field : sig ... end
Sourcemodule Value : sig ... end
Sourcetype 'a t
Sourceval create' : ?on_disconnect:(unit -> unit) -> ?auth:Auth.t -> where_to_connect:[< Async.Socket.Address.t ] Async.Tcp.Where_to_connect.t -> 'a -> 'a t Async.Deferred.Or_error.t
Sourceval create : ?on_disconnect:(unit -> unit) -> ?auth:Auth.t -> where_to_connect:[< Async.Socket.Address.t ] Async.Tcp.Where_to_connect.t -> unit -> [ `Primary ] t Async.Deferred.Or_error.t
Sourceval create_using_sentinel : ?on_disconnect:(unit -> unit) -> ?sentinel_auth:Auth.t -> ?auth:Auth.t -> leader_name:string -> where_to_connect: [< Async.Socket.Address.t ] Async.Tcp.Where_to_connect.t list -> unit -> [ `Primary ] t Async.Deferred.Or_error.t
Sourceval close : _ t -> unit Async.Deferred.t
Sourceval close_finished : _ t -> unit Async.Deferred.t
Sourceval has_close_started : _ t -> bool

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

Sourceval select : [< `Primary | `Replica ] t -> int -> unit Async.Deferred.Or_error.t
Sourceval flushall : [< `Primary ] t -> unit Async.Deferred.Or_error.t
Sourceval flushdb : [< `Primary ] t -> unit Async.Deferred.Or_error.t
Sourceval shutdown : [< `Primary | `Replica | `Sentinel ] t -> unit Async.Deferred.Or_error.t
Sourceval echo : [< `Primary | `Replica ] t -> Key.t -> Key.t Async.Deferred.Or_error.t
Sourceval ping : [< `Primary | `Replica | `Sentinel ] t -> string -> string Async.Deferred.Or_error.t
Sourceval incr : [< `Primary ] t -> Key.t -> int Async.Deferred.Or_error.t
Sourceval del : [< `Primary ] t -> Key.t list -> int Async.Deferred.Or_error.t
Sourceval dbsize : [< `Primary | `Replica ] t -> int Async.Deferred.Or_error.t
Sourceval exists : [< `Primary | `Replica ] t -> Key.t list -> int Async.Deferred.Or_error.t
Sourceval keys : ?pattern:string -> [< `Primary | `Replica ] t -> Key.t list Async.Deferred.Or_error.t
Sourceval rename : [< `Primary ] t -> Key.t -> new_key:Key.t -> unit Async.Deferred.Or_error.t
Sourceval scan : [< `Primary | `Replica ] t -> cursor:Cursor.t -> ?count:int -> ?pattern:string -> unit -> (Cursor.t * Key.t list) Async.Deferred.Or_error.t
Sourceval client_tracking : [< `Primary | `Replica ] 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.

Sourceval set : [< `Primary ] t -> Key.t -> ?expire:Core.Time_ns.Span.t -> Value.t -> unit Async.Deferred.Or_error.t
Sourceval setnx : [< `Primary ] t -> Key.t -> Value.t -> bool Async.Deferred.Or_error.t
Sourceval mset : [< `Primary ] t -> (Key.t * Value.t) list -> unit Async.Deferred.Or_error.t
Sourceval msetnx : [< `Primary ] t -> (Key.t * Value.t) list -> bool Async.Deferred.Or_error.t
Sourceval get : [< `Primary | `Replica ] t -> Key.t -> Value.t option Async.Deferred.Or_error.t
Sourceval mget : [< `Primary ] t -> Key.t list -> Value.t option list Async.Deferred.Or_error.t
Sourceval smembers : [< `Primary | `Replica ] t -> Key.t -> Value.t list Async.Deferred.Or_error.t
Sourceval sismember : [< `Primary | `Replica ] t -> Key.t -> Value.t -> bool Async.Deferred.Or_error.t
Sourceval smismember : [< `Primary | `Replica ] t -> Key.t -> Value.t list -> bool list Async.Deferred.Or_error.t
Sourceval sadd : [< `Primary ] t -> Key.t -> Value.t list -> int Async.Deferred.Or_error.t
Sourceval srem : [< `Primary ] t -> Key.t -> Value.t list -> int Async.Deferred.Or_error.t
Sourceval zadd : [< `Primary ] t -> Key.t -> ([ `Score of float ] * Value.t) list -> int Async.Deferred.Or_error.t
Sourceval zrem : [< `Primary ] t -> Key.t -> Value.t list -> int Async.Deferred.Or_error.t
Sourceval pttl : [< `Primary | `Replica ] t -> Key.t -> [ `Timeout of Core.Time_ns.Span.t | `No_timeout | `No_key ] Async.Deferred.Or_error.t
Sourceval pexpire : [< `Primary ] t -> Key.t -> ?nx:bool -> Core.Time_ns.Span.t -> [ `Set | `Not_set ] Async.Deferred.Or_error.t
Sourceval pexpireat : [< `Primary ] t -> Key.t -> ?nx:bool -> Core.Time_ns.t -> [ `Set | `Not_set ] Async.Deferred.Or_error.t
Sourceval zrange : [< `Primary | `Replica ] t -> Key.t -> min_index:int -> max_index:int -> Value.t list Async.Deferred.Or_error.t
Sourceval zscore : [< `Primary | `Replica ] t -> Key.t -> Value.t -> [ `Score of float ] option Async.Deferred.Or_error.t
Sourceval zrangebylex : [< `Primary | `Replica ] t -> Key.t -> min:Value.t Core.Maybe_bound.t -> max:Value.t Core.Maybe_bound.t -> Value.t list Async.Deferred.Or_error.t
Sourceval zrangebyscore : [< `Primary | `Replica ] t -> Key.t -> min_score:float Core.Maybe_bound.t -> max_score:float Core.Maybe_bound.t -> Value.t list Async.Deferred.Or_error.t
Sourceval zrangebyscore_withscores : [< `Primary | `Replica ] t -> Key.t -> min_score:float Core.Maybe_bound.t -> max_score:float Core.Maybe_bound.t -> (Value.t * [ `Score of float ]) list Async.Deferred.Or_error.t
Sourceval zremrangebyscore : [< `Primary ] t -> Key.t -> min_score:float Core.Maybe_bound.t -> max_score:float Core.Maybe_bound.t -> int Async.Deferred.Or_error.t
Sourceval hexists : [< `Primary | `Replica ] t -> Key.t -> Field.t -> bool Async.Deferred.Or_error.t
Sourceval hset : [< `Primary ] t -> Key.t -> (Field.t * Value.t) list -> int Async.Deferred.Or_error.t
Sourceval hget : [< `Primary | `Replica ] t -> Key.t -> Field.t -> Value.t option Async.Deferred.Or_error.t
Sourceval hmget : [< `Primary | `Replica ] t -> Key.t -> Field.t list -> Value.t option list Async.Deferred.Or_error.t
Sourceval hgetall : [< `Primary | `Replica ] t -> Key.t -> (Field.t * Value.t) list Async.Deferred.Or_error.t
Sourceval hvals : [< `Primary | `Replica ] t -> Key.t -> Value.t list Async.Deferred.Or_error.t
Sourceval hkeys : [< `Primary | `Replica ] t -> Key.t -> Field.t list Async.Deferred.Or_error.t
Sourceval hlen : [< `Primary | `Replica ] t -> Key.t -> int Async.Deferred.Or_error.t
Sourceval hdel : [< `Primary ] t -> Key.t -> Field.t list -> int Async.Deferred.Or_error.t
Sourceval hscan : [< `Primary | `Replica ] t -> cursor:Cursor.t -> ?count:int -> Key.t -> (Cursor.t * (Field.t * Value.t) list) Async.Deferred.Or_error.t
Sourceval keyevent_notifications : [< `Primary | `Replica ] t -> [< Key_event.t ] as 'a list -> ('a * Key.t) Async.Pipe.Reader.t Async.Deferred.Or_error.t
Sourceval keyspace_notifications : [< `Primary | `Replica ] t -> [< Key_event.t ] as 'a list -> [ `Patterns of string list | `Keys of Key.t list ] -> ('a * Key.t) Async.Pipe.Reader.t Async.Deferred.Or_error.t
Sourceval publish : [< `Primary | `Replica ] t -> string -> Key.t -> int Async.Deferred.Or_error.t
Sourceval subscribe : [< `Primary | `Replica ] t -> string list -> (string * Key.t) Async.Pipe.Reader.t Async.Deferred.Or_error.t
Sourceval subscribe_raw : [< `Primary | `Replica ] t -> [ `Literal of string list | `Pattern of string list ] -> consume:((Core.read, Iobuf.seek) Iobuf.t -> subscription:string -> 'a) -> 'a Async.Pipe.Reader.t Async.Deferred.Or_error.t
Sourceval psubscribe : [< `Primary | `Replica ] t -> string list -> (string * Key.t) Async.Pipe.Reader.t Async.Deferred.Or_error.t
Sourceval script_load : [< `Primary | `Replica ] t -> string -> Sha1.t Async.Deferred.Or_error.t
Sourceval evalsha : [< `Primary | `Replica ] t -> Sha1.t -> Key.t list -> Value.t list -> Resp3.t Async.Deferred.Or_error.t
Sourceval raw_command : [< `Primary | `Replica | `Sentinel ] t -> string list -> Resp3.t Async.Deferred.Or_error.t
Sourceval version : [< `Primary | `Replica | `Sentinel ] t -> string Async.Deferred.Or_error.t
Sourceval role : [< `Primary | `Replica | `Sentinel ] t -> Role.t Async.Deferred.Or_error.t
Sourceval acl_setuser : [< `Primary | `Replica | `Sentinel ] t -> username:string -> rules:string list -> unit Async.Deferred.Or_error.t

ACL and authentication commands.

Read here for more:

https://redis.io/docs/manual/security/acl/#command-categories https://redis.io/docs/manual/security/acl/#selectors

Sourceval acl_deluser : [< `Primary | `Replica | `Sentinel ] t -> string list -> int Async.Deferred.Or_error.t
Sourceval acl_users : [< `Primary | `Replica | `Sentinel ] t -> string list Async.Deferred.Or_error.t
Sourceval acl_list : [< `Primary | `Replica | `Sentinel ] t -> string list Async.Deferred.Or_error.t
Sourceval acl_getuser : [< `Primary | `Replica | `Sentinel ] t -> username:string -> Resp3.t Async.Deferred.Or_error.t
Sourceval auth : [< `Primary | `Replica | `Sentinel ] t -> auth:Auth.t -> unit -> unit Async.Deferred.Or_error.t
Sourceval sentinel_leader : [< `Sentinel ] t -> string -> Core.Host_and_port.t Async.Deferred.Or_error.t

Sentinel specific commands.

Read here for more: https://redis.io/docs/manual/sentinel/#sentinel-api

Streams

Sourceval xadd : [< `Primary ] t -> Key.t -> ?stream_id:Stream_id.t -> (Field.t * Value.t) list -> Stream_id.t Async.Deferred.Or_error.t
Sourceval xgroup_create : [< `Primary ] t -> Key.t -> Group.t -> ?stream_id:Stream_id.t -> ?mkstream:unit -> unit -> [ `Ok | `Already_exists ] Async.Deferred.Or_error.t
Sourceval xrange : [< `Primary | `Replica ] t -> Key.t -> ?start:Stream_id.t -> ?end_:Stream_id.t -> ?count:int -> unit -> (Stream_id.t * (Field.t * Value.t) list) list Async.Deferred.Or_error.t
Sourceval xreadgroup : [< `Primary | `Replica ] t -> Group.t -> Consumer.t -> ?count:int -> ?block:[ `Don't_block | `Forever | `For_up_to of Core.Time_ns.Span.t ] -> (Key.t * Stream_id.t option) list -> (Key.t * (Stream_id.t * (Field.t * Value.t) list) list) list Async.Deferred.Or_error.t
Sourceval xclaim : [< `Primary ] t -> ?idle:Core.Time_ns.Span.t -> Key.t -> Group.t -> Consumer.t -> min_idle_time:Core.Time_ns.Span.t -> Stream_id.t list -> (Stream_id.t * (Field.t * Value.t) list) list Async.Deferred.Or_error.t
Sourceval xclaim_justid : [< `Primary ] t -> ?idle:Core.Time_ns.Span.t -> Key.t -> Group.t -> Consumer.t -> min_idle_time:Core.Time_ns.Span.t -> Stream_id.t list -> Stream_id.t list Async.Deferred.Or_error.t
Sourceval xautoclaim : [< `Primary ] t -> Key.t -> Group.t -> Consumer.t -> min_idle_time:Core.Time_ns.Span.t -> start:Stream_id.t -> ?count:int -> unit -> ([ `Next_stream_id of Stream_id.t ] * (Stream_id.t * (Field.t * Value.t) list) list * [ `No_longer_exist of Stream_id.t list ]) Async.Deferred.Or_error.t
Sourceval xack : [< `Primary ] t -> Key.t -> Group.t -> Stream_id.t list -> int Async.Deferred.Or_error.t
OCaml

Innovation. Community. Security.