29RCSIDH(redis_pipeline_h,
"$Id: a893b69b249cb13d09629bb86b4d8d2925db5318 $")
31#include <freeradius-devel/server/connection.h>
32#include <freeradius-devel/server/request.h>
33#include <freeradius-devel/server/trunk.h>
34#include <freeradius-devel/redis/io.h>
35#include <hiredis/async.h>
76 char const **argv,
size_t *argv_len,
109 bool active_oneshot);
Thread local state for a cluster.
Head of a doubly linked list.
void * active_uctx
Uctx to pass to active callback.
fr_redis_trunk_active_t active
Callback to run when the trunk becomes active.
fr_redis_ct_t * rtcluster
Cluster this trunk belongs to.
Represents a single command.
Represents a collection of pipelined commands.
fr_redis_trunk_t * fr_redis_trunk_alloc(fr_redis_ct_t *rtcluster, fr_redis_io_conf_t const *conf, fr_pair_list_t *trigger_args, fr_redis_trunk_active_t active, void *active_uctx, bool active_oneshot)
Allocate a new trunk.
char const * fr_redis_command_get_cmd(fr_redis_command_t *cmd)
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.
fr_redis_async_rcode_t fr_redis_command_set_rcode(fr_redis_command_set_t *cmds)
Extract the rcode from a command set.
fr_redis_pipeline_status_t fr_redis_command_preformatted_add(fr_redis_command_set_t *cmds, char const *cmd_str, size_t cmd_len, fr_redis_command_complete_t complete, void *rctx)
Add an preformatted command to the command set as formatted by redisCommandFormat or it's variants.
void(* fr_redis_command_complete_t)(request_t *request, fr_redis_command_t *cmd, redisReply *reply, void *rctx)
Process the reply from a single command.
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.
int fr_redis_command_set_reset(fr_redis_command_set_t *cmds)
Reset a command set to it's state before enqueuing.
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, bool autofree)
Allocate a new command set.
void fr_redis_command_set_next_node(fr_redis_command_set_t *cmds, fr_redis_io_conf_t *ioconf)
Extract the next node address and port from a command set.
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.
fr_redis_pipeline_status_t
@ FR_REDIS_PIPELINE_OK
No failure.
@ FR_REDIS_PIPELINE_TOO_MANY_REDIRECTS
Redirected too many times.
@ FR_REDIS_PIPELINE_BAD_CMDS
Malformed command set.
@ FR_REDIS_PIPELINE_DST_UNAVAILABLE
Cluster or host is down.
@ FR_REDIS_PIPELINE_FAIL
Generic failure.
void fr_redis_command_set_cancel(fr_redis_command_set_t *cmds)
Cancel a command set.
fr_redis_pipeline_status_t fr_redis_command_argv_add(fr_redis_command_set_t *cmds, size_t argc, char const **argv, size_t *argv_len, fr_redis_command_complete_t complete, void *rctx)
Add a command with arguments to the command set.
fr_redis_pipeline_status_t fr_redis_command_literal_add(fr_redis_command_set_t *cmds, char const *cmd_str, fr_redis_command_complete_t complete, void *rctx)
Add a literal command to the command set.
int fr_redis_command_set_clear(fr_redis_command_set_t *cmds)
void(* fr_redis_trunk_active_t)(fr_redis_trunk_t *rtrunk, void *uctx)
Master include file to access all functions and structures in the library.