File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -1610,6 +1610,41 @@ In other words, there should be a full-mesh connection between the nodes.
1610
1610
1611
1611
})
1612
1612
1613
+ .. _box-protocol-watchers :
1614
+
1615
+ Watchers
1616
+ --------
1617
+
1618
+ The commands below support asynchronous server-client
1619
+ notifications signaled with ``box.broadcast() ``.
1620
+ Servers that support the new feature set the ``IPROTO_FEATURE_WATCHERS ``
1621
+ feature bit (bit 3) in reply to the ``IPROTO_ID `` command.
1622
+ When a connection is closed, all watchers registered for it are unregistered.
1623
+
1624
+ IPROTO_WATCH (code 74)
1625
+ ~~~~~~~~~~~~~~~~~~~~~~
1626
+
1627
+ Registers a new watcher for the given notification key or acknowledges a notification if a watcher is
1628
+ already subscribed.
1629
+ The key name is passed in ``IPROTO_EVENT_KEY `` (code 0x56).
1630
+ The watcher will be notified unconditionally after registration and then every time the key is updated with
1631
+ ``box.broadcast() `` provided the last notification was acknowledged.
1632
+ The server doesn't reply to the request unless it fails to parse the packet.
1633
+
1634
+ IPROTO_UNWATCH (code 75)
1635
+ ~~~~~~~~~~~~~~~~~~~~~~~~
1636
+
1637
+ Unregisters a watcher subscribed for the given notification key.
1638
+ The key name is passed in ``IPROTO_EVENT_KEY `` (code 0x56).
1639
+ A server doesn't reply to the request unless it fails to parse the packet.
1640
+
1641
+ IPROTO_EVENT (code 76)
1642
+ ~~~~~~~~~~~~~~~~~~~~~~
1643
+
1644
+ Sent by the server to notify a client about a key update.
1645
+ The key name is passed in ``IPROTO_EVENT_KEY `` (code 0x56).
1646
+ The key data (optional) is passed in ``IPROTO_EVENT_DATA `` (code 0x57).
1647
+
1613
1648
.. _box_protocol-illustration :
1614
1649
1615
1650
Examples
You can’t perform that action at this time.
0 commit comments