The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Redis asynchronous command pipelining. More...
#include <freeradius-devel/server/connection.h>
#include <freeradius-devel/server/request.h>
#include <freeradius-devel/server/trunk.h>
#include <freeradius-devel/redis/io.h>
#include <hiredis/async.h>
Go to the source code of this file.
Typedefs | |
typedef struct fr_redis_cluster_thread_s | fr_redis_cluster_thread_t |
typedef void(* | fr_redis_command_set_complete_t) (request_t *request, fr_dlist_head_t *completed, void *rctx) |
Do something meaningful with the replies to the commands previously issued. More... | |
typedef void(* | fr_redis_command_set_fail_t) (request_t *request, fr_dlist_head_t *completed, void *rctx) |
Write a failure result to the rctx so that the module is aware that the request failed. More... | |
typedef struct fr_redis_command_set_s | fr_redis_command_set_t |
typedef struct fr_redis_command_s | fr_redis_command_t |
typedef struct fr_redis_trunk_s | fr_redis_trunk_t |
Functions | |
fr_redis_cluster_thread_t * | fr_redis_cluster_thread_alloc (TALLOC_CTX *ctx, fr_event_list_t *el, trunk_conf_t const *tconf) |
Allocate per-thread, per-cluster instance. More... | |
redisReply * | fr_redis_command_get_result (fr_redis_command_t *cmd) |
fr_redis_pipeline_status_t | fr_redis_command_preformatted_add (fr_redis_command_set_t *cmds, char const *cmd_str, size_t cmd_len) |
Add a preformatted/expanded command to the command set. More... | |
fr_redis_command_set_t * | fr_redis_command_set_alloc (TALLOC_CTX *ctx, request_t *request, fr_redis_command_set_complete_t complete, fr_redis_command_set_fail_t fail, void *rctx) |
Allocate a new command set. More... | |
fr_redis_trunk_t * | fr_redis_trunk_alloc (fr_redis_cluster_thread_t *rtcluster, fr_redis_io_conf_t const *conf) |
Allocate a new trunk. More... | |
fr_redis_pipeline_status_t | redis_command_set_enqueue (fr_redis_trunk_t *rtrunk, fr_redis_command_set_t *cmds) |
Enqueue a command set on a specific trunk. More... | |
Redis asynchronous command pipelining.
Definition in file pipeline.h.
typedef struct fr_redis_cluster_thread_s fr_redis_cluster_thread_t |
Definition at line 1 of file pipeline.h.
typedef void(* fr_redis_command_set_complete_t) (request_t *request, fr_dlist_head_t *completed, void *rctx) |
Do something meaningful with the replies to the commands previously issued.
Should mark the request as runnable, if there's a request.
Definition at line 58 of file pipeline.h.
typedef void(* fr_redis_command_set_fail_t) (request_t *request, fr_dlist_head_t *completed, void *rctx) |
Write a failure result to the rctx so that the module is aware that the request failed.
Should mark the request as runnable, if there's a request.
Definition at line 64 of file pipeline.h.
typedef struct fr_redis_command_set_s fr_redis_command_set_t |
Definition at line 1 of file pipeline.h.
typedef struct fr_redis_command_s fr_redis_command_t |
Definition at line 1 of file pipeline.h.
typedef struct fr_redis_trunk_s fr_redis_trunk_t |
Definition at line 1 of file pipeline.h.
Definition at line 41 of file pipeline.h.
fr_redis_cluster_thread_t* fr_redis_cluster_thread_alloc | ( | TALLOC_CTX * | ctx, |
fr_event_list_t * | el, | ||
trunk_conf_t const * | tconf | ||
) |
Allocate per-thread, per-cluster instance.
This structure represents all the connections for a given thread for a given cluster. The structures holds the trunk connections to talk to each cluster member.
Definition at line 647 of file pipeline.c.
redisReply* fr_redis_command_get_result | ( | fr_redis_command_t * | cmd | ) |
fr_redis_pipeline_status_t fr_redis_command_preformatted_add | ( | fr_redis_command_set_t * | cmds, |
char const * | cmd_str, | ||
size_t | cmd_len | ||
) |
Add a preformatted/expanded command to the command set.
The command must either be entirely static, or parented by the command set.
[in] | cmds | Command set to add command to. |
[in] | cmd_str | A fully expanded/formatted command to send to redis. Must be static, or have the same lifetime as the command set (allocated with the command set as the parent). |
[in] | cmd_len | Length of the command. |
Definition at line 292 of file pipeline.c.
fr_redis_command_set_t* fr_redis_command_set_alloc | ( | TALLOC_CTX * | ctx, |
request_t * | request, | ||
fr_redis_command_set_complete_t | complete, | ||
fr_redis_command_set_fail_t | fail, | ||
void * | rctx | ||
) |
Allocate a new command set.
This is a set of commands that the calling module wants to execute on the redis server in sequence.
Control will be returned to the caller via the registered complete and fail functions.
[in] | ctx | to bind the command set's lifetime to. |
[in] | request | to pass to places that need it. |
[in] | complete | Function to call when all commands have been processed. |
[in] | fail | Function to call if the command set was not executed or was partially executed. |
[in] | rctx | Resume context to pass to complete and fail functions. |
Definition at line 206 of file pipeline.c.
fr_redis_trunk_t* fr_redis_trunk_alloc | ( | fr_redis_cluster_thread_t * | cluster_thread, |
fr_redis_io_conf_t const * | io_conf | ||
) |
Allocate a new trunk.
[in] | cluster_thread | to allocate the trunk for. |
[in] | io_conf | Describing the connection to a single REDIS host. |
Definition at line 615 of file pipeline.c.
fr_redis_pipeline_status_t redis_command_set_enqueue | ( | fr_redis_trunk_t * | rtrunk, |
fr_redis_command_set_t * | cmds | ||
) |
Enqueue a command set on a specific trunk.
The command set may be passed around several trunks before it is complete. This is to allow it to follow MOVED and ASK responses.
[in] | rtrunk | to enqueue command set on. |
[in] | cmds | Command set to enqueue. |
Definition at line 392 of file pipeline.c.