46 #define xroad_reactor_create(_name, ...) \
48 xroad_reactor_params_t args = {.params_size = sizeof(xroad_reactor_params_t), ##__VA_ARGS__}; \
49 xroad_reactor_create_ex(_name, args); \
59 xroad_rf_fixed_fd = (1u << 0u),
60 xroad_rf_write_append = (2u << 0u)
61 } xroad_reactor_flags_t;
common epoll callback structure
Definition: xroad_reactor_types.h:25
Structure of parameters.
Definition: xroad_reactor.h:23
bool ur_sq_poll
see IORING_SETUP_SQPOLL in man io_uring_setup
Definition: xroad_reactor.h:31
bool strict_interval
RESERVED.
Definition: xroad_reactor.h:27
unsigned params_size
Size of structure (to support different versions)
Definition: xroad_reactor.h:24
int ur_sq_depth
Size of submission queue (io_uring_params::sq_entries)
Definition: xroad_reactor.h:29
int ur_cq_depth
Size of completion queue (io_uring_params::cq_entries)
Definition: xroad_reactor.h:30
int ur_raw_flags
io_uring additional flags to be set (additional to those which set by the reactor)
Definition: xroad_reactor.h:34
int wait_time_ms
Reactor wait timeout. 0 – busy-wait, -1 – infinit wait.
Definition: xroad_reactor.h:26
int ur_sq_cpu
cpu core for sq_poll
Definition: xroad_reactor.h:32
int ur_num_reg_files
Number of files to be registered within the ring.
Definition: xroad_reactor.h:35
int ur_sq_idle_ms
idle time to stop the sq_poll thread
Definition: xroad_reactor.h:33
Reactor timestamps.
Definition: xroad_reactor_types.h:18
Definition: xroad_string.h:29
void xroad_reactor_set_default(xroad_reactor_t *r)
int xroad_reactor_reg_fd(xroad_reactor_t *r, int fd)
int xroad_reactor_unreg_fd(xroad_reactor_t *r, int reg_fd)
Unregister the file descriptor.
xroad_errno_t xroad_reactor_mod_epoll(xroad_reactor_t *r, uint32_t events, xroad_epoll_callback_t *cback, uint8_t flags)
int32_t xroad_reactor_process_nowait(xroad_reactor_t *r)
xroad_errno_t xroad_reactor_add_epoll(xroad_reactor_t *r, uint32_t events, xroad_epoll_callback_t *cback, uint8_t flags)
xroad_errno_t xroad_reactor_set_interval(xroad_reactor_t *r, int wait_time_ms)
Change wait time.
struct xroad_reactor_s xroad_reactor_t
Opaque reactor structure.
Definition: xroad_reactor.h:19
int xroad_reactor_reg_fd_to_fd(xroad_reactor_t *r, int reg_fd)
Get real (native) file descriptor by registered one (registration index)
int32_t xroad_reactor_get_epoll_fd(xroad_reactor_t *r)
void xroad_reactor_destroy(xroad_reactor_t *r)
const xroad_reactor_timestamps_t * xroad_reactor_get_timestamps(xroad_reactor_t *r) __attribute_const__
Returns pointer to timestamps structure associated with the reactor.
xroad_reactor_t * xroad_reactor_get_default(void)
xroad_reactor_t * xroad_reactor_create_ex(xroad_str_t name, xroad_reactor_params_t params)
int32_t xroad_reactor_process(xroad_reactor_t *r)