Skip to content

Commit b936908

Browse files
authored
Document NT4 table-specific listener pattern (#3131)
Adds explanation of how to achieve table-specific listening in NT4 using NetworkTableInstance.addListener() with topic name prefix filters, since NetworkTable-level listeners were removed in NT4. Fixes #2314
1 parent b902581 commit b936908

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

source/docs/software/networktables/nt4-migration-guide.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ Force set operations have been removed, as it's no longer possible to change a t
160160

161161
The separate connection, value, and log listeners/events have been unified into a single listener/event. The NetworkTable-level listeners have also been removed. Listeners in many cases can be replaced with subscriber ``readQueue()`` calls, but if listeners are still required, they can be used via ``NetworkTableInstance`` (see :ref:`docs/software/networktables/listening-for-change:listening for changes` for more information).
162162

163+
While NetworkTable-level listeners were removed, table-specific listening functionality can be achieved by using ``NetworkTableInstance.addListener()`` with a topic name prefix filter. By passing an array of topic name prefixes (such as ``["/datatable/"]``), the listener will only receive events for topics within that table. This is demonstrated in the :ref:`docs/software/networktables/listening-for-change:using networktableinstance to listen for changes` section.
164+
163165
## Client/Server Operations
164166

165167
Starting a NetworkTable server now requires specifying both the NT3 port and the NT4 port. For a NT4-only server, the NT3 port can be specified as 0.

0 commit comments

Comments
 (0)