@@ -29,8 +29,8 @@ a stream transfers data via the protocol between a client and a server.
29
29
30
30
.. _box_stream-features :
31
31
32
- New features
33
- ------------
32
+ Features
33
+ --------
34
34
35
35
The primary purpose of :term: `streams <stream> ` is to execute transactions via iproto.
36
36
Every stream has its own identifier, which is unique within the connection.
@@ -45,6 +45,9 @@ The ID is generated on the client side automatically.
45
45
If a user writes their own connector and wants to use streams,
46
46
they must transmit the ``stream_id `` over the iproto protocol.
47
47
48
+ Streams only work if the ``box.cfg{} `` option :ref: `memtx_use_mvcc_engine <cfg-basic-memtx-use-mvcc-engine >`
49
+ is enabled on the server: ``memtx_use_mvcc_engine = true ``.
50
+
48
51
.. _box_stream-interaction :
49
52
50
53
Interaction between streams and transactions
@@ -63,7 +66,7 @@ that transaction will be rolled back if it hasn't been committed before the conn
63
66
64
67
Example:
65
68
66
- .. code-block :: lua
69
+ .. code-block :: lua
67
70
68
71
local conn = net_box.connect(remote_server_addr)
69
72
local conn_space = conn.space.test
@@ -72,15 +75,15 @@ Example:
72
75
73
76
-- Begin transaction over an iproto stream:
74
77
stream:begin()
75
- space :replace({1})
78
+ stream_space :replace({1})
76
79
77
80
-- Empty select, the transaction was not committed.
78
81
-- You can't see it from the requests that do not belong to the
79
82
-- transaction.
83
+ conn_space:select{}
80
84
81
85
-- Select returns the previously inserted tuple,
82
86
-- because this select belongs to the transaction:
83
- conn_space:select{}
84
87
stream_space:select({})
85
88
86
89
-- Commit transaction:
0 commit comments