package redis-async
Module type Redis.SSource
Source
val 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.tSource
val 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.tSource
val 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.tRedis commands are documented at: https://redis.io/commands
Source
val ping :
[< `Primary | `Replica | `Sentinel ] t ->
string ->
string Async.Deferred.Or_error.tSource
val keys :
?pattern:string ->
[< `Primary | `Replica ] t ->
Key.t list Async.Deferred.Or_error.tSource
val client_tracking :
[< `Primary | `Replica ] t ->
?bcast:bool ->
unit ->
[ `All | `Key of Key.t ] Async.Pipe.Reader.t Async.Deferred.Or_error.tTurn 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
Source
val set :
[< `Primary ] t ->
Key.t ->
?expire:Core.Time_ns.Span.t ->
Value.t ->
unit Async.Deferred.Or_error.tSource
val sismember :
[< `Primary | `Replica ] t ->
Key.t ->
Value.t ->
bool Async.Deferred.Or_error.tSource
val smismember :
[< `Primary | `Replica ] t ->
Key.t ->
Value.t list ->
bool list Async.Deferred.Or_error.tSource
val zadd :
[< `Primary ] t ->
Key.t ->
([ `Score of float ] * Value.t) list ->
int Async.Deferred.Or_error.tSource
val pttl :
[< `Primary | `Replica ] t ->
Key.t ->
[ `Timeout of Core.Time_ns.Span.t | `No_timeout | `No_key ]
Async.Deferred.Or_error.tSource
val pexpire :
[< `Primary ] t ->
Key.t ->
?nx:bool ->
Core.Time_ns.Span.t ->
[ `Set | `Not_set ] Async.Deferred.Or_error.tSource
val pexpireat :
[< `Primary ] t ->
Key.t ->
?nx:bool ->
Core.Time_ns.t ->
[ `Set | `Not_set ] Async.Deferred.Or_error.tSource
val zrange :
[< `Primary | `Replica ] t ->
Key.t ->
min_index:int ->
max_index:int ->
Value.t list Async.Deferred.Or_error.tSource
val zscore :
[< `Primary | `Replica ] t ->
Key.t ->
Value.t ->
[ `Score of float ] option Async.Deferred.Or_error.tSource
val 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.tSource
val 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.tSource
val 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.tSource
val zremrangebyscore :
[< `Primary ] t ->
Key.t ->
min_score:float Core.Maybe_bound.t ->
max_score:float Core.Maybe_bound.t ->
int Async.Deferred.Or_error.tSource
val hexists :
[< `Primary | `Replica ] t ->
Key.t ->
Field.t ->
bool Async.Deferred.Or_error.tSource
val keyevent_notifications :
[< `Primary | `Replica ] t ->
([< Key_event.t ] as 'a) list ->
('a * Key.t) Async.Pipe.Reader.t Async.Deferred.Or_error.tSource
val 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.tSource
val subscribe :
[< `Primary | `Replica ] t ->
string list ->
(string * Key.t) Async.Pipe.Reader.t Async.Deferred.Or_error.tSource
val 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.tSource
val psubscribe :
[< `Primary | `Replica ] t ->
string list ->
(string * Key.t) Async.Pipe.Reader.t Async.Deferred.Or_error.tSource
val raw_command :
[< `Primary | `Replica | `Sentinel ] t ->
string list ->
Resp3.t Async.Deferred.Or_error.tSource
val acl_setuser :
[< `Primary | `Replica | `Sentinel ] t ->
username:string ->
rules:string list ->
unit Async.Deferred.Or_error.tACL and authentication commands.
Read here for more:
https://redis.io/docs/manual/security/acl/#command-categories https://redis.io/docs/manual/security/acl/#selectors
Source
val acl_deluser :
[< `Primary | `Replica | `Sentinel ] t ->
string list ->
int Async.Deferred.Or_error.tSource
val acl_users :
[< `Primary | `Replica | `Sentinel ] t ->
string list Async.Deferred.Or_error.tSource
val acl_list :
[< `Primary | `Replica | `Sentinel ] t ->
string list Async.Deferred.Or_error.tSource
val acl_getuser :
[< `Primary | `Replica | `Sentinel ] t ->
username:string ->
Resp3.t Async.Deferred.Or_error.tSource
val auth :
[< `Primary | `Replica | `Sentinel ] t ->
auth:Auth.t ->
unit ->
unit Async.Deferred.Or_error.tSource
val sentinel_leader :
[< `Sentinel ] t ->
string ->
Core.Host_and_port.t Async.Deferred.Or_error.tSentinel specific commands.
Read here for more: https://redis.io/docs/manual/sentinel/#sentinel-api
Streams
Source
val xadd :
[< `Primary ] t ->
Key.t ->
?stream_id:Stream_id.t ->
(Field.t * Value.t) list ->
Stream_id.t Async.Deferred.Or_error.tSource
val xgroup_create :
[< `Primary ] t ->
Key.t ->
Group.t ->
?stream_id:Stream_id.t ->
?mkstream:unit ->
unit ->
[ `Ok | `Already_exists ] Async.Deferred.Or_error.tSource
val 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.tSource
val 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.tSource
val 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.tSource
val 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.tSource
val 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.tSource
val xack :
[< `Primary ] t ->
Key.t ->
Group.t ->
Stream_id.t list ->
int Async.Deferred.Or_error.t