package hiredis

  1. Overview
  2. Docs

Module Hiredis.ClientSource

Sourcetype t
Sourceval error_string : t -> string option

Returns the error string associated with a hiredis context

Sourceval connect : ?scripts:(string, string) Hashtbl.t -> ?auth:string -> ?nonblock:bool -> ?port:int -> string -> t

Create a new client connection

Sourceval of_fd : ?scripts:(string, string) Hashtbl.t -> ?close_fd:bool -> Unix.file_descr -> t

Create a new client from an existing file descr

Sourceval to_fd : t -> Unix.file_descr

Get the underlying file descr

Sourceval set_timeout : t -> int -> int -> status

Set a client's timeout

Sourceval enable_keepalive : t -> status

Enable keepalive on the client

Sourceval append_command : t -> string array -> status

Queue command to be executed

Sourceval append_command_v : t -> Value.t array -> status

Similar to append_command but using a command made of Hiredis Value.ts

Sourceval append_formatted : t -> string -> status

Append a pre-formatted command string to be executed

Sourceval append_value : t -> Value.t -> status
Sourceval flush_buffer : t -> status
Sourceval read_buffer : t -> status
Sourceval get_reply : t -> Value.t option

get_reply client executes the queued commands and returns the result

Sourceval run : t -> string array -> Value.t

Execute a command formatted as an array of strings and return the reply immediately

Sourceval run_v : t -> Value.t array -> Value.t

Execute a command formatted as an array of Value.ts and return the reply immediately

Sourceval load_script : t -> string -> string -> unit

load_script name script will load a lua script onto the server and make it available from the existing * client as name

Sourceval call_script : t -> string -> int -> string list -> Value.t

call_script client name nkeys args calls a script by name with the given number of keys and arguments

Sourceval call_script_v : t -> string -> int -> Value.t list -> Value.t

Similar to call_script but with a list of Value.ts for arguments

OCaml

Innovation. Community. Security.