Skip to content

Commit

Permalink
Correct the Streams article (#2735)
Browse files Browse the repository at this point in the history
Resolves #2503
  • Loading branch information
patiencedaur authored Mar 9, 2022
1 parent 6834bc3 commit 6e24105
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
14 changes: 9 additions & 5 deletions doc/book/box/stream.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ a stream transfers data via the protocol between a client and a server.

.. _box_stream-features:

New features
------------
Features
--------

The primary purpose of :term:`streams <stream>` is to execute transactions via iproto.
Every stream has its own identifier, which is unique within the connection.
Expand All @@ -45,6 +45,10 @@ The ID is generated on the client side automatically.
If a user writes their own connector and wants to use streams,
they must transmit the ``stream_id`` over the iproto protocol.

Interactive transactions over streams only work if
the ``box.cfg{}`` option :ref:`memtx_use_mvcc_engine <cfg_basic-memtx_use_mvcc_engine>`
is enabled on the server: ``memtx_use_mvcc_engine = true``.

.. _box_stream-interaction:

Interaction between streams and transactions
Expand All @@ -63,7 +67,7 @@ that transaction will be rolled back if it hasn't been committed before the conn

Example:

.. code-block:: lua
.. code-block:: lua
local conn = net_box.connect(remote_server_addr)
local conn_space = conn.space.test
Expand All @@ -72,15 +76,15 @@ Example:
-- Begin transaction over an iproto stream:
stream:begin()
space:replace({1})
stream_space:replace({1})
-- Empty select, the transaction was not committed.
-- You can't see it from the requests that do not belong to the
-- transaction.
conn_space:select{}
-- Select returns the previously inserted tuple,
-- because this select belongs to the transaction:
conn_space:select{}
stream_space:select({})
-- Commit transaction:
Expand Down
19 changes: 14 additions & 5 deletions locale/ru/LC_MESSAGES/book/box/stream.po
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ msgstr ""
"целиком в рамках одного запроса. ``begin``, ``commit`` и другие TX-"
"инструкции могут быть отправлены и выполнены в разных запросах."

msgid "New features"
msgstr "Новые функциональные возможности"
msgid "Features"
msgstr "Функциональные возможности"

msgid ""
"The primary purpose of :term:`streams <stream>` is to execute transactions "
Expand Down Expand Up @@ -80,6 +80,15 @@ msgstr ""
"поддержкой стримов. Используя стримы с пользовательским коннектором, "
"необходимо передавать ``stream_id`` через протокол iproto."

msgid ""
"Interactive transactions over streams only work if the ``box.cfg{}`` option "
":ref:`memtx_use_mvcc_engine <cfg_basic-memtx_use_mvcc_engine>` is enabled on"
" the server: ``memtx_use_mvcc_engine = true``."
msgstr ""
"Чтобы в стримах работали интерактивные транзакции, необходимо включить "
"параметр ``box.cfg{}`` :ref:`memtx_use_mvcc_engine <cfg_basic-"
"memtx_use_mvcc_engine>` на сервере: ``memtx_use_mvcc_engine = true``."

msgid "Interaction between streams and transactions"
msgstr "Взаимодействие между стримами и транзакциями"

Expand Down Expand Up @@ -122,15 +131,15 @@ msgid ""
"\n"
"-- Begin transaction over an iproto stream:\n"
"stream:begin()\n"
"space:replace({1})\n"
"stream_space:replace({1})\n"
"\n"
"-- Empty select, the transaction was not committed.\n"
"-- You can't see it from the requests that do not belong to the\n"
"-- transaction.\n"
"conn_space:select{}\n"
"\n"
"-- Select returns the previously inserted tuple,\n"
"-- because this select belongs to the transaction:\n"
"conn_space:select{}\n"
"stream_space:select({})\n"
"\n"
"-- Commit transaction:\n"
Expand All @@ -146,7 +155,7 @@ msgstr ""
"\n"
"-- Начать транзакцию через поток iproto:\n"
"stream:begin()\n"
"space:replace({1})\n"
"stream_space:replace({1})\n"
"\n"
"-- Пустой select, коммит транзакции не выполнен.\n"
"-- Ее нельзя увидеть из запросов, не относящихся\n"
Expand Down

0 comments on commit 6e24105

Please sign in to comment.