Skip to content

Commit 4043b80

Browse files
committed
Change iproto and box.session.push re out-of-band
1 parent c99e39b commit 4043b80

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

doc/dev_guide/internals/box_protocol.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ Index
6767
| :ref:`Responses if no error and no | Responses for no SQL |
6868
| SQL <box_protocol-responses>` | |
6969
+----------------------------------------------------+------------------------+
70+
| :ref:`Responses if no error and out-of-band | Responses for |
71+
| <box_protocol-responses_out_of_band>` | out-of-band |
72+
+----------------------------------------------------+------------------------+
7073
| :ref:`Responses for errors | Responses for errors |
7174
| <box_protocol-responses_error>` | |
7275
+----------------------------------------------------+------------------------+
@@ -197,6 +200,7 @@ The IPROTO constants that appear within requests or responses that we will descr
197200
IPROTO_FIELD_IS_NULLABLE=0x03
198201
IPROTO_FIELD_IS_AUTOINCREMENT=0x04
199202
IPROTO_FIELD_SPAN=0x05
203+
IPROTO_CHUNK=0x80
200204
201205
To denote message descriptions we will say ``msgpack(...)`` and within it we will use modified
202206
`YAML <https://en.wikipedia.org/wiki/YAML>`_ so: |br|
@@ -924,6 +928,14 @@ so if we were using net_box we could decode with
924928
or we could convert to a string with :samp:`ffi.string({pointer},{length})`.
925929
The :ref:`pickle.unpack() <pickle-unpack>` function might also be helpful.
926930

931+
.. _box_protocol-responses_out_of_band:
932+
933+
Responses for no error and out-of-band
934+
--------------------------------------
935+
936+
If the response is out-of-band, due to use of
937+
:ref:`box.session.push() <box_session-push>`,
938+
then the header Response-Code-indicator will be IPROTO_CHUNK instead of IPROTO_OK.
927939

928940
.. _box_protocol-responses_error:
929941

doc/reference/reference_lua/box_session/push.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ box.session.push()
3737
* If the result is not an error, then the return is the boolean value ``true``.
3838
* When the return is ``true``, the message has gone to the network
3939
buffer as a :ref:`packet <box_protocol-iproto_protocol>`
40-
with the code IPROTO_CHUNK (0x80).
40+
with a different :ref:`header code <box_protocol-responses_out_of_band>`
41+
so the client can distinguish from an ordinary Okay response.
4142

4243
The server's sole job is to call ``box.session.push()``, there is no
4344
automatic mechanism for showing that the message was received.
@@ -139,4 +140,4 @@ box.session.push()
139140
-- - *0
140141
-- ...
141142
-- Good. That shows that the message was asynchronous, and
142-
-- that box.session.push() did its job.
143+
-- that box.session.push() did its job.

0 commit comments

Comments
 (0)