Skip to content

Commit 97a492e

Browse files
committed
Fixes gh-682 Document new behaviour of session.on_disconnect
1 parent cf6f464 commit 97a492e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

doc/1.10/book/box/box_session.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Below is a list of all ``box.session`` functions and members.
7979
.. function:: id()
8080

8181
:return: the unique identifier (ID) for the current session.
82-
The result can be 0 meaning there is no session.
82+
The result can be 0 or -1 meaning there is no session.
8383
:rtype: number
8484

8585
.. _box_session-exists:
@@ -114,6 +114,7 @@ Below is a list of all ``box.session`` functions and members.
114114

115115
:return: the value of the :code:`sync` integer constant used in the
116116
`binary protocol <https://github.com/tarantool/tarantool/blob/1.10/src/box/iproto_constants.h>`_.
117+
This value becomes invalid when the session is disconnected.
117118

118119
:rtype: number
119120

@@ -330,6 +331,9 @@ Below is a list of all ``box.session`` functions and members.
330331
trigger is invoked while the session associated with the client still exists
331332
and can access session properties, such as :ref:`box.session.id() <box_session-id>`.
332333

334+
Since version 1.10, the trigger function is invoked immediately after the disconnect,
335+
even if requests that were made during the session have not finished.
336+
333337
:param function trigger-function: function which will become the trigger function
334338
:param function old-trigger-function: existing trigger function which will be replaced by trigger-function
335339
:return: nil or function pointer
@@ -495,6 +499,8 @@ Below is a list of all ``box.session`` functions and members.
495499
our terminology for net.box), and the client has options for getting
496500
such messages.
497501

502+
This function returns an error if the session is disconnected.
503+
498504
:param string-or-number message: what to send
499505
:param int sync: an optional argument to indicate what the session is,
500506
as taken from an earlier call to :ref:`box_session:sync() <box_session-sync>`.

0 commit comments

Comments
 (0)