mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 19:48:20 +00:00
broker/cluster: Add cluster shims for 7.0
For making Zeek 7.0 compatible with the new Cluster::* methods coming with Zeek 7.1/7.2.
This commit is contained in:
parent
4021a0c654
commit
8600cfa882
8 changed files with 143 additions and 0 deletions
|
@ -295,6 +295,12 @@ export {
|
|||
## Returns: a topic string that may used to send a message exclusively to
|
||||
## a given cluster node.
|
||||
global nodeid_topic: function(id: string): string;
|
||||
|
||||
## Delegate to Broker::__subscribe()
|
||||
global subscribe: function(topic_prefix: string): bool;
|
||||
|
||||
## Delegate to Broker::__unsubscribe()
|
||||
global unsubscribe: function(topic_prefix: string): bool;
|
||||
}
|
||||
|
||||
# Track active nodes per type.
|
||||
|
@ -519,3 +525,13 @@ function log(msg: string)
|
|||
{
|
||||
Log::write(Cluster::LOG, [$ts = network_time(), $node = node, $message = msg]);
|
||||
}
|
||||
|
||||
function subscribe(topic_prefix: string): bool
|
||||
{
|
||||
return Broker::__subscribe(topic_prefix);
|
||||
}
|
||||
|
||||
function unsubscribe(topic_prefix: string): bool
|
||||
{
|
||||
return Broker::__unsubscribe(topic_prefix);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue