![]() |
The FreeRADIUS server $Id: f3670dba8951ca10eb4948feb3dc3db9423a334f $
|
Redis asynchronous I/O connection allocation. More...
#include "config.h"#include <freeradius-devel/redis/base.h>#include <freeradius-devel/util/event.h>#include <freeradius-devel/server/connection.h>#include <hiredis/async.h>
Include dependency graph for io.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | fr_redis_handle_t |
| Store I/O state. More... | |
| struct | fr_redis_io_conf_t |
| struct | fr_redis_sqn_ignore_t |
Typedefs | |
| typedef uint64_t | fr_redis_sqn_t |
Functions | |
| connection_t * | fr_redis_connection_alloc (TALLOC_CTX *ctx, fr_event_list_t *el, connection_conf_t const *conn_conf, fr_redis_io_conf_t const *io_conf, char const *log_prefix) |
| Allocate an async redis I/O connection. | |
| redisAsyncContext * | fr_redis_connection_get_async_ctx (connection_t *conn) |
| Return the redisAsyncContext associated with the connection. | |
| static void | fr_redis_connection_ignore_response (fr_redis_handle_t *h, fr_redis_sqn_t sqn) |
| Ignore a response with a specific sequence number. | |
| static bool | fr_redis_connection_process_response (fr_redis_handle_t *h) |
| Update the response sequence number and check if we should ignore the response. | |
| static fr_redis_sqn_t | fr_redis_connection_sent_request (fr_redis_handle_t *h) |
| Tell the handle we sent a command, and get the SQN that command was assigned. | |
Redis asynchronous I/O connection allocation.
Definition in file io.h.
| struct fr_redis_handle_t |
Store I/O state.
There are three layers of wrapping structures
connection_t -> fr_redis_handle_t -> redisAsyncContext
Collaboration diagram for fr_redis_handle_t:| Data Fields | ||
|---|---|---|
| redisAsyncContext * | ac | Async handle for hiredis. |
| fr_event_fd_t * | fd_ev | IO event. |
| bool | freeing | Ensure that redisAsyncFree doesn't cause a callback loop. |
| fr_dlist_head_t | ignore | Contains SQNs for responses that should be ignored. |
| bool | read_set | We're listening for reads. |
| fr_redis_sqn_t | req_sqn |
Current redis request number. Note: It would take 5.8 million years running at 100,000 requests/s to overflow, but my OCD requires that the max uses for trunk connections is set to UINT64_MAX if not specified by the user. It's one branch, and it makes me happy, deal with it. |
| fr_redis_sqn_t | rsp_sqn | Current redis response number. |
| fr_timer_t * | timer_ev | Connection timer. |
| bool | write_set | We're listening for writes. |
| struct fr_redis_io_conf_t |
| struct fr_redis_sqn_ignore_t |
| typedef uint64_t fr_redis_sqn_t |
| connection_t * fr_redis_connection_alloc | ( | TALLOC_CTX * | ctx, |
| fr_event_list_t * | el, | ||
| connection_conf_t const * | conn_conf, | ||
| fr_redis_io_conf_t const * | io_conf, | ||
| char const * | log_prefix | ||
| ) |
| redisAsyncContext * fr_redis_connection_get_async_ctx | ( | connection_t * | conn | ) |
|
inlinestatic |
|
inlinestatic |
Update the response sequence number and check if we should ignore the response.
MUST be called for every reply received using the handle. Relies on the fact that responses from REDIS are FIFO with requests.
| [in] | h | to check for ignored responses. |
Definition at line 134 of file io.h.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Tell the handle we sent a command, and get the SQN that command was assigned.
MUST be called for every command sent using the handle. Relies on the fact that responses from REDIS are FIFO with requests.
| [in] | h | the request was sent on. |
Definition at line 106 of file io.h.
Here is the caller graph for this function:
1.9.8