base/bif/messaging.bif.bro

Broker
Cluster
GLOBAL

Functions for peering and various messaging patterns.

Namespaces:Broker, Cluster, GLOBAL
Source File:/scripts/base/bif/messaging.bif.bro

Summary

Functions

Broker::__auto_publish: function  
Broker::__auto_unpublish: function  
Broker::__flush_logs: function  
Broker::__publish_id: function  
Broker::__subscribe: function  
Broker::__unsubscribe: function  
Broker::make_event: function Create a data structure that may be used to send a remote event via Broker::publish.
Broker::publish: function Publishes an event at a given topic.
Broker::relay: function Publishes an event at a given topic, with any receivers automatically forwarding it to its peers with a different topic.
Cluster::publish_hrw: function Publishes an event to a node within a pool according to Rendezvous (Highest Random Weight) hashing strategy.
Cluster::publish_rr: function Publishes an event to a node within a pool according to Round-Robin distribution strategy.
Cluster::relay_hrw: function Publishes an event at a given topic, with a receiver node chosen from a pool according to Rendezvous (Highest Random Weight) distribution strategy.
Cluster::relay_rr: function Publishes an event at a given topic, with a receiver node chosen from a pool according to Round-Robin distribution strategy.

Detailed Interface

Functions

Broker::__auto_publish
Type:function (topic: string, ev: any) : bool
Broker::__auto_unpublish
Type:function (topic: string, ev: any) : bool
Broker::__flush_logs
Type:function () : count
Broker::__publish_id
Type:function (topic: string, id: string) : bool
Broker::__subscribe
Type:function (topic_prefix: string) : bool
Broker::__unsubscribe
Type:function (topic_prefix: string) : bool
Broker::make_event
Type:function (va_args: any) : Broker::Event

Create a data structure that may be used to send a remote event via Broker::publish.

Args:an event, followed by a list of argument values that may be used to call it.
Returns:opaque communication data that may be used to send a remote event.
Broker::publish
Type:function (va_args: any) : bool

Publishes an event at a given topic.

Topic:a topic associated with the event message.
Args:Either the event arguments as already made by Broker::make_event or the argument list to pass along to it.
Returns:true if the message is sent.
Broker::relay
Type:function (va_args: any) : bool

Publishes an event at a given topic, with any receivers automatically forwarding it to its peers with a different topic. The event is relayed at most a single hop.

First_topic:the initial topic to use for publishing the event.
Args:the first member of the argument list may be either a string or a set of strings indicating the secondary topic that the first set of receivers will use to re-publish the event. The remaining members of the argument list are either the return value of a previously-made call to Broker::make_event or the argument list that should be passed along to it, so that it can be called as part of executing this function.
Returns:true if the message is sent.
Cluster::publish_hrw
Type:function (va_args: any) : bool

Publishes an event to a node within a pool according to Rendezvous (Highest Random Weight) hashing strategy.

Pool:the pool of nodes that are eligible to receive the revent
Key:data used for input to the hashing function that will uniformly distribute keys among available nodes.
Args:Either the event arguments as already made by Broker::make_event or the argument list to pass along to it.
Returns:true if the message is sent.
Cluster::publish_rr
Type:function (va_args: any) : bool

Publishes an event to a node within a pool according to Round-Robin distribution strategy.

Pool:the pool of nodes that are eligible to receive the revent
Key:an arbitrary string to identify the purpose for which you’re distributing the event. e.g. consider using namespacing of your script like “Intel::cluster_rr_key”.
Args:Either the event arguments as already made by Broker::make_event or the argument list to pass along to it.
Returns:true if the message is sent.
Cluster::relay_hrw
Type:function (va_args: any) : bool

Publishes an event at a given topic, with a receiver node chosen from a pool according to Rendezvous (Highest Random Weight) distribution strategy. The receiving nodes then automatically forwards it to its peers with a different topic. The event is relayed at most a single hop.

Pool:the pool of nodes that are eligible to receive the revent
Key:data used for input to the hashing function that will uniformly distribute keys among available nodes.
Args:the first member of the argument list may be either a string or a set of strings indicating the secondary topic that the receiver will use to re-publish the event. The remaining members of the argument list are either the return value of a previously-made call to Broker::make_event or the argument list that should be passed along to it, so that it can be called as part of executing this function.
Returns:true if the message is sent.
Cluster::relay_rr
Type:function (va_args: any) : bool

Publishes an event at a given topic, with a receiver node chosen from a pool according to Round-Robin distribution strategy. The receiving node, then automatically forwards it to its peers with a different topic. The event is relayed at most a single hop.

Pool:the pool of nodes that are eligible to receive the event
Key:an arbitrary string to identify the purpose for which you’re distributing the event. e.g. consider using namespacing of your script like “Intel::cluster_rr_key”.
Args:the first member of the argument list may be either a string or a set of strings indicating the secondary topic that the receiver will use to re-publish the event. The remaining members of the argument list are either the return value of a previously-made call to Broker::make_event or the argument list that should be passed along to it, so that it can be called as part of executing this function.
Returns:true if the message is sent.

Previous Page

base/bif/comm.bif.bro

Copyright 2016, The Bro Project. Last updated on May 25, 2018. Created using Sphinx 1.6.6.