cluster: Add on_subscribe() and on_unsubscribe() hooks

Closes #4176
This commit is contained in:
Arne Welzel 2025-07-30 11:01:12 +02:00
parent aabb36abf7
commit 1a87ebab72
9 changed files with 77 additions and 9 deletions

View file

@ -401,6 +401,20 @@ export {
## The value of the X-Application-Name HTTP header, if any.
application_name: string &optional;
};
## A hook invoked for every :zeek:see:`Cluster::subscribe` call.
##
## Breaking from this hook has no effect.
##
## topic: The topic string as given to :zeek:see:`Cluster::subscribe`.
global on_subscribe: hook(topic: string);
## A hook invoked for every :zeek:see:`Cluster::subscribe` call.
##
## Breaking from this hook has no effect.
##
## topic: The topic string as given to :zeek:see:`Cluster::subscribe`.
global on_unsubscribe: hook(topic: string);
}
# Needs declaration of Cluster::Event type.