{ FR_CONF_OFFSET("per_connection_max", trunk_conf_t, max_req_per_conn), .dflt = "2000" },
{ FR_CONF_OFFSET("per_connection_target", trunk_conf_t, target_req_per_conn), .dflt = "1000" },
{ FR_CONF_OFFSET("free_delay", trunk_conf_t, req_cleanup_delay), .dflt = "10.0" },
+ { FR_CONF_OFFSET("triggers", trunk_conf_t, req_triggers) },
CONF_PARSER_TERMINATOR
};
{ FR_CONF_OFFSET("max_backlog", trunk_conf_t, max_backlog), .dflt = "1000" },
+ { FR_CONF_OFFSET("triggers", trunk_conf_t, conn_triggers) },
+
{ FR_CONF_OFFSET_SUBSECTION("connection", 0, trunk_conf_t, conn_conf, trunk_config_connection), .subcs_size = sizeof(trunk_config_connection) },
{ FR_CONF_POINTER("request", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) trunk_config_request },
static size_t trunk_connection_events_len = NUM_ELEMENTS(trunk_connection_events);
#define CONN_TRIGGER(_state) do { \
- if (trunk->pub.triggers) { \
+ if (trunk->conf.conn_triggers) { \
trigger(unlang_interpret_get_thread_default(), \
NULL, fr_table_str_by_value(trunk_conn_trigger_names, _state, \
"<INVALID>"), true, NULL); \
trunk_request_t *treq, trunk_request_state_t new) CC_HINT(nonnull);
#define REQUEST_TRIGGER(_state) do { \
- if (trunk->pub.triggers) { \
+ if (trunk->conf.req_triggers) { \
trigger(unlang_interpret_get_thread_default(), \
NULL, fr_table_str_by_value(trunk_req_trigger_names, _state, \
"<INVALID>"), true, NULL); \
bool backlog_on_failed_conn; //!< Assign requests to the backlog when there are no
//!< available connections and the last connection event
//!< was a failure, instead of failing them immediately.
+
+ bool conn_triggers; //!< Do we run connection related triggers?
+
+ bool req_triggers; //!< Do we run request related triggers?
} trunk_conf_t;
/** Public fields for the trunk
uint64_t _CONST req_alloc_reused; //!< How many requests were reused.
/** @} */
- bool _CONST triggers; //!< do we run the triggers?
-
trunk_state_t _CONST state; //!< Current state of the trunk.
};