From bbd65bcc74e2c1473be1a505196ff9259527465a Mon Sep 17 00:00:00 2001 From: Michael Dopheide Date: Sun, 27 May 2018 20:49:15 -0500 Subject: [PATCH] A suggestion for reminding folks about calling events in Module namespaces. --- doc/frameworks/broker.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/frameworks/broker.rst b/doc/frameworks/broker.rst index 23b1f91478..fa17a35963 100644 --- a/doc/frameworks/broker.rst +++ b/doc/frameworks/broker.rst @@ -376,6 +376,28 @@ This section contains a few brief examples of how various communication patterns one might use when developing Bro scripts that are to operate in the context of a cluster. +A Reminder About Events and Module Namespaces +--------------------------------------------- + +For the following examples, please keep in mind that when referring to event names that were +defined inside a module namespace, you should always use that namespace scoping when referring to the event name, even within the module itself. For instance: + +.. code:: bro + + module ModuleName; + + event manager_to_workers(s: string) + { + print "got event from manager", s; + } + + event some_event_handled_on_manager() + { + Broker::publish(Cluster::worker_topic, ModuleName::manager_to_workers, + "hello v0"); + } + + Manager Sending Events To Workers ---------------------------------