mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
MINOR: event_hdl: add PAT_REF events
This is some prerequisite work for implementing PAT_REF events. In this commit we define the PAT_REF event_hdl family (which gets family slot id #2), with the following supported events: - EVENT_HDL_SUB_PAT_REF_ADD: element was added to the current version of the pattern ref - EVENT_HDL_SUB_PAT_REF_DEL: element was deleted from the current version of the pattern ref - EVENT_HDL_SUB_PAT_REF_SET: element was modified in the current version of the pattern ref - EVENT_HDL_SUB_PAT_REF_COMMIT: pending element(s) was/were commited in the current version of the pattern ref - EVENT_HDL_SUB_PAT_REF_CLEAR: all elements were cleared from the current version of the pattern ref The goal is to be able to track a pat_ref struct in order to be notified when it is updated. For performance reasons, events from this family won't provide any additional info, and will only be published in the pat_ref subscription list. Indeed, pat_ref may be updated at a relatively high frequency (or worse, batch work), so we cannot afford doing expensive treatment for each update.
This commit is contained in:
parent
f8b697c19b
commit
f7267bd315
@ -263,8 +263,6 @@ struct event_hdl_sub {
|
||||
* event type to string conversions
|
||||
*/
|
||||
|
||||
/* TODO */
|
||||
|
||||
/* SERVER FAMILY, provides event_hdl_cb_data_server struct
|
||||
* (will be defined in haproxy/server-t.h)
|
||||
*/
|
||||
@ -282,6 +280,16 @@ struct event_hdl_sub {
|
||||
/* server inet addr (addr:svc_port tuple) change event */
|
||||
#define EVENT_HDL_SUB_SERVER_INETADDR EVENT_HDL_SUB_TYPE(1,8)
|
||||
|
||||
/* PAT_REF family, only published in pat ref subscription list
|
||||
* (not published in global subscription list for performance reasons)
|
||||
*/
|
||||
#define EVENT_HDL_SUB_PAT_REF EVENT_HDL_SUB_FAMILY(2)
|
||||
#define EVENT_HDL_SUB_PAT_REF_ADD EVENT_HDL_SUB_TYPE(2,1)
|
||||
#define EVENT_HDL_SUB_PAT_REF_DEL EVENT_HDL_SUB_TYPE(2,2)
|
||||
#define EVENT_HDL_SUB_PAT_REF_SET EVENT_HDL_SUB_TYPE(2,3)
|
||||
#define EVENT_HDL_SUB_PAT_REF_COMMIT EVENT_HDL_SUB_TYPE(2,4)
|
||||
#define EVENT_HDL_SUB_PAT_REF_CLEAR EVENT_HDL_SUB_TYPE(2,5)
|
||||
|
||||
/* --------------------------------------- */
|
||||
|
||||
/* Please reflect changes above in event_hdl_sub_type_map defined
|
||||
|
@ -42,6 +42,12 @@ static struct event_hdl_sub_type_map event_hdl_sub_type_map[] = {
|
||||
{"SERVER_ADMIN", EVENT_HDL_SUB_SERVER_ADMIN},
|
||||
{"SERVER_CHECK", EVENT_HDL_SUB_SERVER_CHECK},
|
||||
{"SERVER_INETADDR", EVENT_HDL_SUB_SERVER_INETADDR},
|
||||
{"PAT_REF", EVENT_HDL_SUB_PAT_REF},
|
||||
{"PAT_REF_ADD", EVENT_HDL_SUB_PAT_REF_ADD},
|
||||
{"PAT_REF_DEL", EVENT_HDL_SUB_PAT_REF_DEL},
|
||||
{"PAT_REF_SET", EVENT_HDL_SUB_PAT_REF_SET},
|
||||
{"PAT_REF_COMMIT", EVENT_HDL_SUB_PAT_REF_COMMIT},
|
||||
{"PAT_REF_CLEAR", EVENT_HDL_SUB_PAT_REF_CLEAR},
|
||||
};
|
||||
|
||||
/* internal types (only used in this file) */
|
||||
|
Loading…
Reference in New Issue
Block a user