AnyEvent-RipeRedis-Cluster

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


- utf8 => $boolean

    If enabled, all strings will be converted to UTF-8 before sending to nodes,
    and all results will be decoded from UTF-8.

    Enabled by default.

- connection\_timeout => $fractional\_seconds

    Specifies connection timeout. If the client could not connect to the node
    after specified timeout, the `on_node_error` callback is called with the
    `E_CANT_CONN` error. The timeout specifies in seconds and can contain a
    fractional part.

        connection_timeout => 10.5,

    By default the client use kernel's connection timeout.

- read\_timeout => $fractional\_seconds

    Specifies read timeout. If the client could not receive a reply from the node
    after specified timeout, the client close connection and call the
    `on_node_error` callback with the `E_READ_TIMEDOUT` error. The timeout is
    specifies in seconds and can contain a fractional part.

        read_timeout => 3.5,

    Not set by default.

- lazy => $boolean

    If enabled, the initial connection to the startup node establishes at time when
    you will send the first command to the cluster. By default the initial
    connection establishes after calling of the `new` method.

    Disabled by default.

- reconnect => $boolean

    If the connection to the node was lost and the parameter `reconnect` is
    TRUE (default), the client will try to restore the connection when you execute
    next command. The client will try to reconnect only once and, if attempt fails,
    the error object is passed to command callback. If you need several attempts of
    the reconnection, you must retry a command from the callback as many times, as
    you need. Such behavior allows to control reconnection procedure.

    Enabled by default.

- reconnect\_interval => $fractional\_seconds

    If the parameter is specified, the client will try to reconnect only after
    this interval. Commands executed between reconnections will be queued.

        reconnect_interval => 5,

    Not set by default.

- refresh\_interval => $fractional\_seconds

    Cluster state refresh interval. If set to zero, cluster state will be updated
    only on MOVED redirect.

    By default is 15 seconds.

- handle\_params => \\%params

    Specifies [AnyEvent::Handle](https://metacpan.org/pod/AnyEvent::Handle) parameters.

        handle_params => {
          autocork => 1,
          linger   => 60,
        }

    Enabling of the `autocork` parameter can improve performance. See
    documentation on [AnyEvent::Handle](https://metacpan.org/pod/AnyEvent::Handle) for more information.

- on\_node\_connect => $cb->( $host, $port )

    The `on_node_connect` callback is called when the connection to particular
    node is successfully established. To callback are passed two arguments: host
    and port of the node to which the client was connected.

    Not set by default.

- on\_node\_disconnect => $cb->( $host, $port )

    The `on_node_disconnect` callback is called when the connection to particular
    node is closed by any reason. To callback are passed two arguments: host and
    port of the node from which the client was disconnected.

    Not set by default.

- on\_node\_error => $cb->( $err, $host, $port )

    The `on_node_error` callback is called when occurred an error, which was
    affected on entire node (e. g. connection error or authentication error). Also
    the `on_node_error` callback can be called on command errors if the command
    callback is not specified. To callback are passed three arguments: error object,
    and host and port of the node on which an error occurred.

    Not set by default.

- on\_error => $cb->( $err )

    The `on_error` callback is called when occurred an error, which was affected
    on entire client (e. g. nodes discovery error). Also the `on_error` callback is
    called on command errors if the command callback is not specified. If the
    `on_error` callback is not specified, the client just print an error messages
    to `STDERR`.

# COMMAND EXECUTION

## <command>( \[ @args \] \[, ( $cb->( $reply, $err ) | \\%cbs ) \] )

To execute the command you must call particular method with corresponding name.
The reply to the command is passed to the callback in first argument. If any
error occurred during the command execution, the error object is passed to the
callback in second argument. The error object is the instance of the class
[AnyEvent::RipeRedis::Error](https://metacpan.org/pod/AnyEvent::RipeRedis::Error).



( run in 2.399 seconds using v1.01-cache-2.11-cpan-df04353d9ac )