Module resty.cassandra.policies.retry.simple
Simple retry policy.
This policy will retry requests that failed because of UNAVAILABLEEXCEPTION, READTIMEOUT or WRITE_TIMEOUT server errors up to a given number of time before failing and returning an error.
Info:
- Author: thibaultcha
Functions
new (max_retries) | Create a simple retry policy. |
Functions
- new (max_retries)
-
Create a simple retry policy.
Instanciates a simple retry policy for
resty.cassandra.cluster.
Parameters:
- max_retries number Maximum number of retries for a query before aborting and reporting the error.
Returns:
-
table
policy
: A simple retry policy.Usage:
local Cluster = require "resty.cassandra.cluster" local simple_retry = require "resty.cassandra.policies.retry.simple" local policy = simple_retry.new(3) local cluster = assert(Cluster.new { retry_policy = policy })