Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Commit 839b238

Browse files
committed
broker/cluster: Changes for auto_publish() deprecation
1 parent 87504ba commit 839b238

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

frameworks/broker.rst

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -276,19 +276,11 @@ define any event handlers for events that peers will send.
276276
:linenos:
277277
:tab-width: 4
278278

279-
There are two different ways to send events.
280-
281-
The first is to call the :zeek:see:`Broker::publish` function which you can
279+
To send an event, call the :zeek:see:`Broker::publish` function which you can
282280
supply directly with the event and its arguments or give it the return value of
283281
:zeek:see:`Broker::make_event` in case you need to send the same event/args
284282
multiple times. When publishing events like this, local event handlers for
285-
the event are not called.
286-
287-
The second option is to call the :zeek:see:`Broker::auto_publish` function where
288-
you specify a particular event that will be automatically sent to peers
289-
whenever the event is called locally via the normal event invocation syntax.
290-
When auto-publishing events, local event handlers for the event are called
291-
in addition to sending the event to any subscribed peers.
283+
the event are not called, even if a matching subscription exists.
292284

293285
.. literalinclude:: broker/events-connector.zeek
294286
:caption: events-connector.zeek
@@ -301,6 +293,20 @@ to the ``zeek/events`` topic prefix you would receive events that are published
301293
to topic names ``zeek/events/foo`` and ``zeek/events/bar`` but not
302294
``zeek/misc``.
303295

296+
297+
.. note::
298+
299+
In prior Zeek versions, :zeek:see:`Broker::auto_publish` was available to
300+
automatically send events to peers whenever the event ere called locally via
301+
the normal event invocation syntax. When auto-publishing events, local
302+
event handlers for the event were called in addition to sending the
303+
event to any subscribed peers.
304+
305+
:zeek:see:`Broker::auto_publish` has been deprecated due to its
306+
`implicit nature <https://github.com/zeek/zeek/discussions/3637>`_.
307+
308+
.. deprecated:: 7.1
309+
304310
Remote Logging
305311
--------------
306312

frameworks/cluster.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,6 @@ function to publish events, including:
334334
- Standard function to send an event to all nodes subscribed to a given
335335
topic
336336

337-
* - :zeek:see:`Broker::auto_publish`
338-
- Automatically send an otherwise generated Zeek event to any interested
339-
peers whenever it is locally dispatched.
340-
- Avoid, since it is somewhat “magical”, unless you’ve got code
341-
compartmentalization running with ``@ifdef`` directives.
342-
343337
* - :zeek:see:`Cluster::publish_hrw`
344338
- Publishes an event to a node within a pool according to
345339
Highest Random Weight (HRW) hashing strategy; see details below

0 commit comments

Comments
 (0)