rspamd_redis
This module implements redis asynchronous client for rspamd LUA API. Here is an example of using of this module:
Functions:
Function | Description |
---|---|
rspamd_redis.make_request({params}) |
Make request to redis server, params is a table of key=value arguments in any order. |
rspamd_redis.make_request_sync({params}) |
Make blocking request to redis server, params is a table of key=value arguments in any order. |
rspamd_redis.connect({params}) |
Make request to redis server, params is a table of key=value arguments in any order. |
rspamd_redis.connect_sync({params}) |
Make blocking request to redis server, params is a table of key=value arguments in any order. |
Methods:
Method | Description |
---|---|
rspamd_redis:add_cmd(cmd, {args}) |
Append new cmd to redis pipeline. |
rspamd_redis:exec() |
Executes pending commands (suitable for blocking IO only for now). |
The module rspamd_redis
defines the following functions.
rspamd_redis.make_request({params})
Make request to redis server, params is a table of key=value arguments in any order
Parameters:
task {task}
: worker task objecthost {ip|string}
: server addresscallback {function}
: callback to be called in form function (task, err, data)
cmd {string}
: command to be sent to redisargs {table}
: numeric array of strings used as redis argumentstimeout {number}
: timeout in seconds for request (1.0 by default)Returns:
{boolean}
: true
if a request has been scheduledBack to module description.
rspamd_redis.make_request_sync({params})
Make blocking request to redis server, params is a table of key=value arguments in any order
Parameters:
host {ip|string}
: server addresscmd {string}
: command to be sent to redisargs {table}
: numeric array of strings used as redis argumentstimeout {number}
: timeout in seconds for request (1.0 by default)Returns:
{boolean + result}
: true
and a result if a request has been successfulBack to module description.
rspamd_redis.connect({params})
Make request to redis server, params is a table of key=value arguments in any order
Parameters:
task {task}
: worker task objecthost {ip|string}
: server addresstimeout {number}
: timeout in seconds for request (1.0 by default)Returns:
{boolean,redis}
: new connection object or nil if connection failedBack to module description.
rspamd_redis.connect_sync({params})
Make blocking request to redis server, params is a table of key=value arguments in any order
Parameters:
host {ip|string}
: server addresstimeout {number}
: timeout in seconds for request (1.0 by default)Returns:
{redis}
: redis object if a request has been successfulBack to module description.
The module rspamd_redis
defines the following methods.
rspamd_redis:add_cmd(cmd, {args})
Append new cmd to redis pipeline
Parameters:
cmd {string}
: command to be sent to redisargs {table}
: array of strings used as redis argumentsReturns:
{boolean}
: true
if a request has been successfulBack to module description.
rspamd_redis:exec()
Executes pending commands (suitable for blocking IO only for now)
Parameters:
No parameters
Returns:
{boolean}
: , {table}, …: pairs in format [bool, result] for each request pendingBack to module description.
Back to top.