From c120f783fb4fa96c3e407d32fdee73e55afde2d5 Mon Sep 17 00:00:00 2001 From: Maria Strabykina <102664960+rindblack15@users.noreply.github.com> Date: Thu, 2 Jun 2022 09:54:11 +0300 Subject: [PATCH 01/13] Update net_box-connect --- doc/reference/reference_lua/net_box.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index 8900df514a..8dcd0696a4 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -205,6 +205,18 @@ Below is a list of all ``net.box`` functions. also use ``conn`` database methods (in this case, only the binary protocol is supported). Deprecation notice: ``console = true`` is deprecated, users should use :ref:`console.connect() ` instead. + + * ``required_protocol_version``: depending on the value of the option, the connection requires the + minimum version of the IPROTO protocol supported by the server. If the server version is lower + than specified, the connection will fail with an error message. + With ``required_protocol_version = 1`` all connections fail where the server protocol is lower than ``1``. + + * ``required_protocol_features``: depending on the value of the option, the connection requires + the specified IPROTO protocol features supported by the server. If the server does not have + the specified features, the connection will fail with an error message. + With ``required_protocol_features = {'transactions'}`` all connections fail where the server + has ``transaction: false``. + * `connect_timeout`: number of seconds to wait before returning "error: Connection timed out". @@ -221,6 +233,7 @@ Below is a list of all ``net.box`` functions. conn = net_box.connect('localhost:3301') conn = net_box.connect('127.0.0.1:3302', {wait_connected = false}) conn = net_box.connect('127.0.0.1:3303', {reconnect_after = 5, call_16 = true}) + conn = net_box.connect('127.0.0.1:3304', {required_protocol_version = 4, required_protocol_features = {'transactions'}, }) .. _net_box-self: From b79b4513908602f034fde1084c26b11518c0a1ec Mon Sep 17 00:00:00 2001 From: Maria Strabykina <102664960+rindblack15@users.noreply.github.com> Date: Thu, 2 Jun 2022 11:02:40 +0300 Subject: [PATCH 02/13] Add details to required_protocol_features option --- doc/reference/reference_lua/net_box.rst | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index 8dcd0696a4..231da66dbc 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -164,12 +164,12 @@ Below is a list of all ``net.box`` functions. Possible options: - * `user/password`: you have two ways to connect to a remote host: + * `user/password`: you have two ways to connect to a remote host: using :ref:`URI ` or using the options `user` and `password`. For example, instead of ``connect('username:userpassword@localhost:33301')`` you can write ``connect('localhost:33301', {user = 'username', password='userpassword'})``. - * `wait_connected`: by default, connection creation is blocked until the connection is established, + * `wait_connected`: by default, connection creation is blocked until the connection is established, but passing ``wait_connected=false`` makes it return immediately. Also, passing a timeout makes it wait before returning (e.g. ``wait_connected=1.5`` makes it wait at most 1.5 seconds). @@ -178,7 +178,7 @@ Below is a list of all ``net.box`` functions. If ``reconnect_after`` is greater than zero, then ``wait_connected`` ignores transient failures. The wait completes once the connection is established or is closed explicitly. - * `reconnect_after`: if ``reconnect_after`` is greater than zero, then a ``net.box`` instance + * `reconnect_after`: if ``reconnect_after`` is greater than zero, then a ``net.box`` instance will try to reconnect if a connection is broken or if a connection attempt fails. This makes transient network failures become transparent to the application. Reconnect happens automatically in the background, so requests that @@ -189,7 +189,7 @@ Below is a list of all ``net.box`` functions. removes it, then reconnect attempts stop. The default value of ``reconnect_after``, as with other ``connect`` options, is ``nil``. - * `call_16`: [since 1.7.2] by default, ``net.box`` connections comply with a new + * `call_16`: [since 1.7.2] by default, ``net.box`` connections comply with a new binary protocol command for CALL, which is not backward compatible with previous versions. The new CALL no longer restricts a function to returning an array of tuples and allows returning an arbitrary MsgPack/JSON result, including scalars, nil and void (nothing). @@ -198,7 +198,7 @@ Below is a list of all ``net.box`` functions. All programming language drivers will be gradually changed to use the new CALL. To connect to a Tarantool instance that uses the old CALL, specify ``call_16=true``. - * `console`: depending on the option's value, the connection supports different methods + * `console`: depending on the option's value, the connection supports different methods (as if instances of different classes were returned). With ``console = true``, you can use ``conn`` methods ``close()``, ``is_connected()``, ``wait_state()``, ``eval()`` (in this case, both binary and Lua console network protocols are supported). With ``console = false`` (default), you can @@ -206,19 +206,19 @@ Below is a list of all ``net.box`` functions. Deprecation notice: ``console = true`` is deprecated, users should use :ref:`console.connect() ` instead. - * ``required_protocol_version``: depending on the value of the option, the connection requires the + * ``required_protocol_version``: depending on the value of the option, the connection requires the minimum version of the IPROTO protocol supported by the server. If the server version is lower than specified, the connection will fail with an error message. With ``required_protocol_version = 1`` all connections fail where the server protocol is lower than ``1``. - * ``required_protocol_features``: depending on the value of the option, the connection requires - the specified IPROTO protocol features supported by the server. If the server does not have - the specified features, the connection will fail with an error message. - With ``required_protocol_features = {'transactions'}`` all connections fail where the server - has ``transaction: false``. + * ``required_protocol_features``: depending on the value of the option, the connection requires + the specified :ref:`IPROTO protocol features `supported by the server. You can + specify one or more features. If the server does not have the specified features, the connection + will fail with an error message. With ``required_protocol_features = {'transactions'}`` all + connections fail where the server has ``transaction: false``. - * `connect_timeout`: number of seconds to wait before returning "error: Connection timed out". + * `connect_timeout`: number of seconds to wait before returning "error: Connection timed out". :param string URI: the :ref:`URI ` of the target for the connection :param options: possible options are `user`, `password`, `wait_connected`, @@ -637,7 +637,7 @@ Below is a list of all ``net.box`` functions. .. _conn-new_stream: - .. method:: stream([options]) + .. method:: new_stream([options]) Create a stream. From ce52ca92eeb8d70d5ddb5252276857f9adf4e82e Mon Sep 17 00:00:00 2001 From: Maria Strabykina <102664960+rindblack15@users.noreply.github.com> Date: Thu, 2 Jun 2022 11:27:18 +0300 Subject: [PATCH 03/13] Improve the style --- doc/reference/reference_lua/net_box.rst | 85 ++++++++++++------------- 1 file changed, 41 insertions(+), 44 deletions(-) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index 231da66dbc..e9c55fea5f 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -164,65 +164,62 @@ Below is a list of all ``net.box`` functions. Possible options: - * `user/password`: you have two ways to connect to a remote host: - using :ref:`URI ` or using the options `user` and `password`. For - example, instead of ``connect('username:userpassword@localhost:33301')`` you - can write ``connect('localhost:33301', {user = 'username', password='userpassword'})``. + * `user/password`: you have two ways to connect to a remote host: + using :ref:`URI ` or using the options `user` and `password`. For + example, instead of ``connect('username:userpassword@localhost:33301')`` you + can write ``connect('localhost:33301', {user = 'username', password='userpassword'})``. - * `wait_connected`: by default, connection creation is blocked until the connection is established, - but passing ``wait_connected=false`` makes it return immediately. Also, passing a timeout - makes it wait before returning (e.g. ``wait_connected=1.5`` makes it wait at most 1.5 seconds). + * `wait_connected`: by default, connection creation is blocked until the connection is established, + but passing ``wait_connected=false`` makes it return immediately. Also, passing a timeout + makes it wait before returning (e.g. ``wait_connected=1.5`` makes it wait at most 1.5 seconds). .. NOTE:: If ``reconnect_after`` is greater than zero, then ``wait_connected`` ignores transient failures. The wait completes once the connection is established or is closed explicitly. - * `reconnect_after`: if ``reconnect_after`` is greater than zero, then a ``net.box`` instance - will try to reconnect if a connection is broken or if a connection attempt fails. - This makes transient network failures become transparent to the application. - Reconnect happens automatically in the background, so requests that - initially fail due to connectivity loss are transparently retried. - The number of retries is unlimited, connection attempts are made after each - specified interval (for example ``reconnect_after=5`` means try to reconnect every 5 seconds). - When a connection is explicitly closed, or when the Lua garbage collector - removes it, then reconnect attempts stop. - The default value of ``reconnect_after``, as with other ``connect`` options, is ``nil``. - - * `call_16`: [since 1.7.2] by default, ``net.box`` connections comply with a new - binary protocol command for CALL, which is not backward compatible with previous versions. - The new CALL no longer restricts a function to returning an array of tuples - and allows returning an arbitrary MsgPack/JSON result, including scalars, nil and void (nothing). - The old CALL is left intact for backward compatibility. - It will be removed in the next major release. - All programming language drivers will be gradually changed to use the new CALL. - To connect to a Tarantool instance that uses the old CALL, specify ``call_16=true``. - - * `console`: depending on the option's value, the connection supports different methods - (as if instances of different classes were returned). With ``console = true``, you can use - ``conn`` methods ``close()``, ``is_connected()``, ``wait_state()``, ``eval()`` (in this case, both - binary and Lua console network protocols are supported). With ``console = false`` (default), you can - also use ``conn`` database methods (in this case, only the binary protocol is supported). - Deprecation notice: ``console = true`` is deprecated, users should use - :ref:`console.connect() ` instead. + * `reconnect_after`: if ``reconnect_after`` is greater than zero, then a ``net.box`` instance + will try to reconnect if a connection is broken or if a connection attempt fails. + This makes transient network failures become transparent to the application. + Reconnect happens automatically in the background, so requests that initially fail + due to connectivity loss are transparently retried. The number of retries is unlimited, + connection attempts are made after each specified interval (for example ``reconnect_after=5`` + means try to reconnect every 5 seconds). When a connection is explicitly closed, or when the + Lua garbage collector removes it, then reconnect attempts stop. The default value of ``reconnect_after``, + as with other ``connect`` options, is ``nil``. + + * `call_16`: [since 1.7.2] by default, ``net.box`` connections comply with a new binary protocol + command for CALL, which is not backward compatible with previous versions. The new CALL no longer + restricts a function to returning an array of tuples and allows returning an arbitrary MsgPack/JSON result, + including scalars, nil and void (nothing). The old CALL is left intact for backward compatibility. It will be + removed in the next major release. All programming language drivers will be gradually changed to use the new CALL. + To connect to a Tarantool instance that uses the old CALL, specify ``call_16=true``. + + * `console`: depending on the option's value, the connection supports different methods (as if instances + of different classes were returned). With ``console = true``, you can use ``conn`` methods ``close()``, + ``is_connected()``, ``wait_state()``, ``eval()`` (in this case, both binary and Lua console network protocols + are supported). With ``console = false`` (default), you can also use ``conn`` database methods (in this case, + only the binary protocol is supported). Deprecation notice: ``console = true`` is deprecated, users should use + :ref:`console.connect() ` instead. * ``required_protocol_version``: depending on the value of the option, the connection requires the - minimum version of the IPROTO protocol supported by the server. If the server version is lower - than specified, the connection will fail with an error message. - With ``required_protocol_version = 1`` all connections fail where the server protocol is lower than ``1``. + minimum version of the IPROTO protocol supported by the server. If the server version is lower than + specified, the connection will fail with an error message. With ``required_protocol_version = 1`` + all connections fail where the server protocol is lower than ``1``. - * ``required_protocol_features``: depending on the value of the option, the connection requires - the specified :ref:`IPROTO protocol features `supported by the server. You can - specify one or more features. If the server does not have the specified features, the connection - will fail with an error message. With ``required_protocol_features = {'transactions'}`` all - connections fail where the server has ``transaction: false``. + * ``required_protocol_features``: depending on the value of the option, the connection requires the + specified :ref:`IPROTO protocol features `supported by the server. You can specify one + or more features. If the server does not have the specified features, the connection will fail with an + error message. With ``required_protocol_features = {'transactions'}`` all connections fail where the + server has ``transaction: false``. * `connect_timeout`: number of seconds to wait before returning "error: Connection timed out". :param string URI: the :ref:`URI ` of the target for the connection - :param options: possible options are `user`, `password`, `wait_connected`, - `reconnect_after`, `call_16`, `console` and `connect_timeout` + :param options: possible options are ``user``, ``password``, ``wait_connected``, + ``reconnect_after``, ``call_16``, ``console``, ``required_protocol_version``, ``required_protocol_features`` + and ``connect_timeout`` :return: conn object :rtype: userdata From 7503d8412b954ca3f6ed0de1de348c12dd466ac0 Mon Sep 17 00:00:00 2001 From: Maria Strabykina <102664960+rindblack15@users.noreply.github.com> Date: Thu, 2 Jun 2022 13:58:30 +0300 Subject: [PATCH 04/13] Add a table to required_protocol_features --- doc/reference/reference_lua/net_box.rst | 111 +++++++++++++++--------- 1 file changed, 68 insertions(+), 43 deletions(-) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index e9c55fea5f..07a2a30e29 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -12,7 +12,7 @@ The ``net.box`` module contains connectors to remote database systems. One variant, to be discussed later, is for connecting to MySQL or MariaDB or PostgreSQL (see :ref:`SQL DBMS modules ` reference). The other variant, which is discussed in this section, is for connecting to Tarantool server instances via a -network. +network. You can call the following methods: @@ -164,57 +164,82 @@ Below is a list of all ``net.box`` functions. Possible options: - * `user/password`: you have two ways to connect to a remote host: - using :ref:`URI ` or using the options `user` and `password`. For - example, instead of ``connect('username:userpassword@localhost:33301')`` you - can write ``connect('localhost:33301', {user = 'username', password='userpassword'})``. + * ``user/password``: you have two ways to connect to a remote host: + using :ref:`URI ` or using the options `user` and `password`. For + example, instead of ``connect('username:userpassword@localhost:33301')`` + you can write ``connect('localhost:33301', {user = 'username', password='userpassword'})``. - * `wait_connected`: by default, connection creation is blocked until the connection is established, - but passing ``wait_connected=false`` makes it return immediately. Also, passing a timeout - makes it wait before returning (e.g. ``wait_connected=1.5`` makes it wait at most 1.5 seconds). + * ``wait_connected``: by default, connection creation is blocked until the connection is established, but passing + ``wait_connected=false`` makes it return immediately. Also, passing a timeout makes it wait before returning + (e.g. ``wait_connected=1.5`` makes it wait at most 1.5 seconds). .. NOTE:: If ``reconnect_after`` is greater than zero, then ``wait_connected`` ignores transient failures. The wait completes once the connection is established or is closed explicitly. - * `reconnect_after`: if ``reconnect_after`` is greater than zero, then a ``net.box`` instance - will try to reconnect if a connection is broken or if a connection attempt fails. - This makes transient network failures become transparent to the application. - Reconnect happens automatically in the background, so requests that initially fail - due to connectivity loss are transparently retried. The number of retries is unlimited, - connection attempts are made after each specified interval (for example ``reconnect_after=5`` - means try to reconnect every 5 seconds). When a connection is explicitly closed, or when the - Lua garbage collector removes it, then reconnect attempts stop. The default value of ``reconnect_after``, - as with other ``connect`` options, is ``nil``. - - * `call_16`: [since 1.7.2] by default, ``net.box`` connections comply with a new binary protocol - command for CALL, which is not backward compatible with previous versions. The new CALL no longer - restricts a function to returning an array of tuples and allows returning an arbitrary MsgPack/JSON result, - including scalars, nil and void (nothing). The old CALL is left intact for backward compatibility. It will be - removed in the next major release. All programming language drivers will be gradually changed to use the new CALL. - To connect to a Tarantool instance that uses the old CALL, specify ``call_16=true``. - - * `console`: depending on the option's value, the connection supports different methods (as if instances - of different classes were returned). With ``console = true``, you can use ``conn`` methods ``close()``, - ``is_connected()``, ``wait_state()``, ``eval()`` (in this case, both binary and Lua console network protocols - are supported). With ``console = false`` (default), you can also use ``conn`` database methods (in this case, - only the binary protocol is supported). Deprecation notice: ``console = true`` is deprecated, users should use - :ref:`console.connect() ` instead. + * ``reconnect_after``: if ``reconnect_after`` is greater than zero, then a ``net.box`` instance will try + to reconnect if a connection is broken or if a connection attempt fails. This makes transient network + failures become transparent to the application. Reconnect happens automatically in the background, + so requests that initially fail due to connectivity loss are transparently retried. The number of + retries is unlimited, connection attempts are made after each specified interval (for example ``reconnect_after=5`` + means try to reconnect every 5 seconds). When a connection is explicitly closed, or when the Lua garbage collector + removes it, then reconnect attempts stop. The default value of ``reconnect_after``, as with other ``connect`` + options, is ``nil``. + + * ``call_16``: [since 1.7.2] by default, ``net.box`` connections comply with a new binary protocol command for CALL, + which is not backward compatible with previous versions. The new CALL no longer restricts a function to returning + an array of tuples and allows returning an arbitrary MsgPack/JSON result, including scalars, nil and void (nothing). + The old CALL is left intact for backward compatibility. It will be removed in the next major release. All programming + language drivers will be gradually changed to use the new CALL. To connect to a Tarantool instance that uses the old + CALL, specify ``call_16=true``. + + * ``console``: depending on the option's value, the connection supports different methods (as if instances of different + classes were returned). With ``console = true``, you can use ``conn`` methods ``close()``, ``is_connected()``, + ``wait_state()``, ``eval()`` (in this case, both binary and Lua console network protocols are supported). With + ``console = false`` (default), you can also use ``conn`` database methods (in this case, only the binary protocol is + supported). Deprecation notice: ``console = true`` is deprecated, users should use :ref:`console.connect() ` instead. - * ``required_protocol_version``: depending on the value of the option, the connection requires the - minimum version of the IPROTO protocol supported by the server. If the server version is lower than - specified, the connection will fail with an error message. With ``required_protocol_version = 1`` - all connections fail where the server protocol is lower than ``1``. + * ``required_protocol_version``: depending on the value of the option, the connection requires the minimum version + of the IPROTO protocol supported by the server. If the server version is lower than specified, the connection will + fail with an error message. With ``required_protocol_version = 1`` all connections fail where the server protocol is + lower than ``1``. - * ``required_protocol_features``: depending on the value of the option, the connection requires the - specified :ref:`IPROTO protocol features `supported by the server. You can specify one - or more features. If the server does not have the specified features, the connection will fail with an - error message. With ``required_protocol_features = {'transactions'}`` all connections fail where the - server has ``transaction: false``. - - - * `connect_timeout`: number of seconds to wait before returning "error: Connection timed out". + * ``required_protocol_features``: depending on the value of the option, the connection requires the specified + IPROTO protocol features supported by the server. You can specify one or more ``net.box`` features + from the table below. If the server does not have the specified features, the connection will fail with an error message. + With ``required_protocol_features = {'transactions'}`` all connections fail where the server has ``transaction: false``. + + .. container:: table + + .. list-table:: + :widths: 20 30 25 25 + :header-rows: 1 + + * - ``net.box`` feature + - Use + - IPROTO feature ID + - First protocol version with ``net.box`` feature + * - ``streams`` + - Requires streams support on the server. + - IPROTO_FEATURE_STREAMS + - 1 + * - ``transactions`` + - Requires transactions support on the server. + - IPROTO_FEATURE_TRANSACTIONS` + - 1 + * - ``error_extension`` + - Requires support for :ref:`MP_ERROR ` MsgPack extension on the server. + - IPROTO_FEATURE_ERROR_EXTENSION + - 2 + * - ``watchers`` + - Requires remote watchers support on the server. + - IPROTO_FEATURE_WATCHERS + - 3 + + To learn more about IPROTO features, see :ref:`IPROTO_ID `. + + * ``connect_timeout``: number of seconds to wait before returning "error: Connection timed out". :param string URI: the :ref:`URI ` of the target for the connection :param options: possible options are ``user``, ``password``, ``wait_connected``, From 5250c961014d068121514f35800f40276dd79c51 Mon Sep 17 00:00:00 2001 From: Maria Strabykina <102664960+rindblack15@users.noreply.github.com> Date: Thu, 2 Jun 2022 14:56:08 +0300 Subject: [PATCH 05/13] Move the connect_timeout option --- doc/reference/reference_lua/net_box.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index 07a2a30e29..b63485c960 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -199,6 +199,8 @@ Below is a list of all ``net.box`` functions. ``wait_state()``, ``eval()`` (in this case, both binary and Lua console network protocols are supported). With ``console = false`` (default), you can also use ``conn`` database methods (in this case, only the binary protocol is supported). Deprecation notice: ``console = true`` is deprecated, users should use :ref:`console.connect() ` instead. + + * ``connect_timeout``: number of seconds to wait before returning "error: Connection timed out". * ``required_protocol_version``: depending on the value of the option, the connection requires the minimum version of the IPROTO protocol supported by the server. If the server version is lower than specified, the connection will @@ -210,6 +212,7 @@ Below is a list of all ``net.box`` functions. from the table below. If the server does not have the specified features, the connection will fail with an error message. With ``required_protocol_features = {'transactions'}`` all connections fail where the server has ``transaction: false``. + .. container:: table .. list-table:: @@ -226,7 +229,7 @@ Below is a list of all ``net.box`` functions. - 1 * - ``transactions`` - Requires transactions support on the server. - - IPROTO_FEATURE_TRANSACTIONS` + - IPROTO_FEATURE_TRANSACTIONS - 1 * - ``error_extension`` - Requires support for :ref:`MP_ERROR ` MsgPack extension on the server. @@ -237,9 +240,8 @@ Below is a list of all ``net.box`` functions. - IPROTO_FEATURE_WATCHERS - 3 - To learn more about IPROTO features, see :ref:`IPROTO_ID `. + To learn more about IPROTO features, see :ref:`IPROTO_ID `. - * ``connect_timeout``: number of seconds to wait before returning "error: Connection timed out". :param string URI: the :ref:`URI ` of the target for the connection :param options: possible options are ``user``, ``password``, ``wait_connected``, From c8b35e0b4f18992960e289f428f48259011b9ca2 Mon Sep 17 00:00:00 2001 From: Maria Strabykina <102664960+rindblack15@users.noreply.github.com> Date: Fri, 3 Jun 2022 11:28:08 +0300 Subject: [PATCH 06/13] Change table headers --- doc/reference/reference_lua/net_box.rst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index b63485c960..fd44e92fad 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -163,15 +163,15 @@ Below is a list of all ``net.box`` functions. such as select, update or delete. Possible options: - + * ``user/password``: you have two ways to connect to a remote host: - using :ref:`URI ` or using the options `user` and `password`. For + using :ref:`URI ` or using the options `user` and `password`. For example, instead of ``connect('username:userpassword@localhost:33301')`` you can write ``connect('localhost:33301', {user = 'username', password='userpassword'})``. * ``wait_connected``: by default, connection creation is blocked until the connection is established, but passing ``wait_connected=false`` makes it return immediately. Also, passing a timeout makes it wait before returning - (e.g. ``wait_connected=1.5`` makes it wait at most 1.5 seconds). + (``wait_connected=1.5`` makes it wait at most 1.5 seconds). .. NOTE:: @@ -216,33 +216,34 @@ Below is a list of all ``net.box`` functions. .. container:: table .. list-table:: - :widths: 20 30 25 25 + :widths: 25 30 25 20 :header-rows: 1 - * - ``net.box`` feature + * - net.box feature - Use - IPROTO feature ID - - First protocol version with ``net.box`` feature + - First protocol version with net.box feature * - ``streams`` - - Requires streams support on the server. + - Requires streams support on the server - IPROTO_FEATURE_STREAMS - 1 * - ``transactions`` - - Requires transactions support on the server. + - Requires transactions support on the server - IPROTO_FEATURE_TRANSACTIONS - 1 * - ``error_extension`` - - Requires support for :ref:`MP_ERROR ` MsgPack extension on the server. + - Requires support for :ref:`MP_ERROR ` MsgPack extension on the server - IPROTO_FEATURE_ERROR_EXTENSION - 2 * - ``watchers`` - - Requires remote watchers support on the server. + - Requires remote watchers support on the server - IPROTO_FEATURE_WATCHERS - 3 To learn more about IPROTO features, see :ref:`IPROTO_ID `. + :param string URI: the :ref:`URI ` of the target for the connection :param options: possible options are ``user``, ``password``, ``wait_connected``, ``reconnect_after``, ``call_16``, ``console``, ``required_protocol_version``, ``required_protocol_features`` From 3cfa6844f433dc0a471e9f500745cb87cff16beb Mon Sep 17 00:00:00 2001 From: Maria Strabykina <102664960+rindblack15@users.noreply.github.com> Date: Fri, 3 Jun 2022 13:06:27 +0300 Subject: [PATCH 07/13] Restructure net.box options --- doc/reference/reference_lua/net_box.rst | 46 ++++++++++--------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index fd44e92fad..8efb47e469 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -11,8 +11,8 @@ Module net.box The ``net.box`` module contains connectors to remote database systems. One variant, to be discussed later, is for connecting to MySQL or MariaDB or PostgreSQL (see :ref:`SQL DBMS modules ` reference). The other variant, which -is discussed in this section, is for connecting to Tarantool server instances via a -network. +is discussed in this section, is for connecting to Tarantool server instances via a +network. You can call the following methods: @@ -147,6 +147,8 @@ Below is a list of all ``net.box`` functions. .. function:: connect(URI [, {option[s]}]) +For more options, see the description of ``net_box.new()`` below. + .. _net_box-new: .. function:: new(URI [, {option[s]}]) @@ -162,22 +164,22 @@ Below is a list of all ``net.box`` functions. The returned ``conn`` object supports methods for making remote requests, such as select, update or delete. - Possible options: + :param string URI: the :ref:`URI ` of the target for the connection + :param options: * ``user/password``: you have two ways to connect to a remote host: - using :ref:`URI ` or using the options `user` and `password`. For - example, instead of ``connect('username:userpassword@localhost:33301')`` - you can write ``connect('localhost:33301', {user = 'username', password='userpassword'})``. - + using :ref:`URI ` or using the options `user` and `password`. For example, instead + of ``connect('username:userpassword@localhost:3301')`` you can write + ``connect('localhost:3301', {user = 'username', password='userpassword'})``. * ``wait_connected``: by default, connection creation is blocked until the connection is established, but passing ``wait_connected=false`` makes it return immediately. Also, passing a timeout makes it wait before returning (``wait_connected=1.5`` makes it wait at most 1.5 seconds). - + .. NOTE:: - If ``reconnect_after`` is greater than zero, then ``wait_connected`` ignores transient failures. - The wait completes once the connection is established or is closed explicitly. - + If ``reconnect_after``: is greater than zero, then ``wait_connected`` ignores transient failures. + The wait completes once the connection is established or is closed explicitly. + * ``reconnect_after``: if ``reconnect_after`` is greater than zero, then a ``net.box`` instance will try to reconnect if a connection is broken or if a connection attempt fails. This makes transient network failures become transparent to the application. Reconnect happens automatically in the background, @@ -186,34 +188,28 @@ Below is a list of all ``net.box`` functions. means try to reconnect every 5 seconds). When a connection is explicitly closed, or when the Lua garbage collector removes it, then reconnect attempts stop. The default value of ``reconnect_after``, as with other ``connect`` options, is ``nil``. - * ``call_16``: [since 1.7.2] by default, ``net.box`` connections comply with a new binary protocol command for CALL, which is not backward compatible with previous versions. The new CALL no longer restricts a function to returning an array of tuples and allows returning an arbitrary MsgPack/JSON result, including scalars, nil and void (nothing). The old CALL is left intact for backward compatibility. It will be removed in the next major release. All programming language drivers will be gradually changed to use the new CALL. To connect to a Tarantool instance that uses the old CALL, specify ``call_16=true``. - * ``console``: depending on the option's value, the connection supports different methods (as if instances of different classes were returned). With ``console = true``, you can use ``conn`` methods ``close()``, ``is_connected()``, ``wait_state()``, ``eval()`` (in this case, both binary and Lua console network protocols are supported). With ``console = false`` (default), you can also use ``conn`` database methods (in this case, only the binary protocol is supported). Deprecation notice: ``console = true`` is deprecated, users should use :ref:`console.connect() ` instead. - - * ``connect_timeout``: number of seconds to wait before returning "error: Connection timed out". - + * ``connect_timeout``: number of seconds to wait before returning "error: Connection timed out". * ``required_protocol_version``: depending on the value of the option, the connection requires the minimum version of the IPROTO protocol supported by the server. If the server version is lower than specified, the connection will fail with an error message. With ``required_protocol_version = 1`` all connections fail where the server protocol is - lower than ``1``. - + lower than ``1``. * ``required_protocol_features``: depending on the value of the option, the connection requires the specified IPROTO protocol features supported by the server. You can specify one or more ``net.box`` features from the table below. If the server does not have the specified features, the connection will fail with an error message. With ``required_protocol_features = {'transactions'}`` all connections fail where the server has ``transaction: false``. - - - .. container:: table + + .. container:: table .. list-table:: :widths: 25 30 25 20 @@ -241,13 +237,7 @@ Below is a list of all ``net.box`` functions. - 3 To learn more about IPROTO features, see :ref:`IPROTO_ID `. - - - - :param string URI: the :ref:`URI ` of the target for the connection - :param options: possible options are ``user``, ``password``, ``wait_connected``, - ``reconnect_after``, ``call_16``, ``console``, ``required_protocol_version``, ``required_protocol_features`` - and ``connect_timeout`` + :return: conn object :rtype: userdata From f6186d1658f5d6638722b406e1c638f7c9c19329 Mon Sep 17 00:00:00 2001 From: Maria Strabykina <102664960+rindblack15@users.noreply.github.com> Date: Fri, 3 Jun 2022 13:31:41 +0300 Subject: [PATCH 08/13] Remove spaces --- doc/reference/reference_lua/net_box.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index 8efb47e469..c8c4147e57 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -174,12 +174,12 @@ For more options, see the description of ``net_box.new()`` below. * ``wait_connected``: by default, connection creation is blocked until the connection is established, but passing ``wait_connected=false`` makes it return immediately. Also, passing a timeout makes it wait before returning (``wait_connected=1.5`` makes it wait at most 1.5 seconds). - + .. NOTE:: - If ``reconnect_after``: is greater than zero, then ``wait_connected`` ignores transient failures. - The wait completes once the connection is established or is closed explicitly. - + If ``reconnect_after`` is greater than zero, then ``wait_connected`` ignores transient failures. + The wait completes once the connection is established or is closed explicitly. + * ``reconnect_after``: if ``reconnect_after`` is greater than zero, then a ``net.box`` instance will try to reconnect if a connection is broken or if a connection attempt fails. This makes transient network failures become transparent to the application. Reconnect happens automatically in the background, @@ -209,7 +209,7 @@ For more options, see the description of ``net_box.new()`` below. from the table below. If the server does not have the specified features, the connection will fail with an error message. With ``required_protocol_features = {'transactions'}`` all connections fail where the server has ``transaction: false``. - .. container:: table + .. container:: table .. list-table:: :widths: 25 30 25 20 From e7a51bbf4c01543be5312ce1c5fdb115c10c90f3 Mon Sep 17 00:00:00 2001 From: Maria Strabykina <102664960+rindblack15@users.noreply.github.com> Date: Mon, 6 Jun 2022 06:16:58 +0300 Subject: [PATCH 09/13] Edit parameters of net_box.new --- doc/reference/reference_lua/net_box.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index c8c4147e57..ecb8053110 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -165,8 +165,7 @@ For more options, see the description of ``net_box.new()`` below. such as select, update or delete. :param string URI: the :ref:`URI ` of the target for the connection - :param options: - + :param options: the supported options are shown below: * ``user/password``: you have two ways to connect to a remote host: using :ref:`URI ` or using the options `user` and `password`. For example, instead of ``connect('username:userpassword@localhost:3301')`` you can write @@ -212,7 +211,7 @@ For more options, see the description of ``net_box.new()`` below. .. container:: table .. list-table:: - :widths: 25 30 25 20 + :widths: 26 29 25 20 :header-rows: 1 * - net.box feature From 919b90c14f1bd1feb0e39b1570cc85a1ff53b8a1 Mon Sep 17 00:00:00 2001 From: Maria Strabykina <102664960+rindblack15@users.noreply.github.com> Date: Wed, 8 Jun 2022 12:59:47 +0300 Subject: [PATCH 10/13] Fixed remarks --- doc/reference/reference_lua/net_box.rst | 115 +++++++++++++----------- 1 file changed, 62 insertions(+), 53 deletions(-) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index ecb8053110..d76314baa6 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -147,17 +147,14 @@ Below is a list of all ``net.box`` functions. .. function:: connect(URI [, {option[s]}]) -For more options, see the description of ``net_box.new()`` below. + The names ``connect()`` and ``new()`` are synonyms: ``connect()`` is + preferred; ``new()`` is retained for backward compatibility. For more + information, see the description of ``net_box.new()`` below. .. _net_box-new: .. function:: new(URI [, {option[s]}]) - .. NOTE:: - - The names ``connect()`` and ``new()`` are synonyms: ``connect()`` is - preferred; ``new()`` is retained for backward compatibility. - Create a new connection. The connection is established on demand, at the time of the first request. It can be re-established automatically after a disconnect (see ``reconnect_after`` option below). @@ -166,47 +163,59 @@ For more options, see the description of ``net_box.new()`` below. :param string URI: the :ref:`URI ` of the target for the connection :param options: the supported options are shown below: - * ``user/password``: you have two ways to connect to a remote host: - using :ref:`URI ` or using the options `user` and `password`. For example, instead - of ``connect('username:userpassword@localhost:3301')`` you can write - ``connect('localhost:3301', {user = 'username', password='userpassword'})``. - * ``wait_connected``: by default, connection creation is blocked until the connection is established, but passing - ``wait_connected=false`` makes it return immediately. Also, passing a timeout makes it wait before returning - (``wait_connected=1.5`` makes it wait at most 1.5 seconds). - - .. NOTE:: - - If ``reconnect_after`` is greater than zero, then ``wait_connected`` ignores transient failures. - The wait completes once the connection is established or is closed explicitly. - - * ``reconnect_after``: if ``reconnect_after`` is greater than zero, then a ``net.box`` instance will try - to reconnect if a connection is broken or if a connection attempt fails. This makes transient network - failures become transparent to the application. Reconnect happens automatically in the background, - so requests that initially fail due to connectivity loss are transparently retried. The number of - retries is unlimited, connection attempts are made after each specified interval (for example ``reconnect_after=5`` - means try to reconnect every 5 seconds). When a connection is explicitly closed, or when the Lua garbage collector - removes it, then reconnect attempts stop. The default value of ``reconnect_after``, as with other ``connect`` - options, is ``nil``. - * ``call_16``: [since 1.7.2] by default, ``net.box`` connections comply with a new binary protocol command for CALL, - which is not backward compatible with previous versions. The new CALL no longer restricts a function to returning - an array of tuples and allows returning an arbitrary MsgPack/JSON result, including scalars, nil and void (nothing). - The old CALL is left intact for backward compatibility. It will be removed in the next major release. All programming - language drivers will be gradually changed to use the new CALL. To connect to a Tarantool instance that uses the old - CALL, specify ``call_16=true``. - * ``console``: depending on the option's value, the connection supports different methods (as if instances of different - classes were returned). With ``console = true``, you can use ``conn`` methods ``close()``, ``is_connected()``, - ``wait_state()``, ``eval()`` (in this case, both binary and Lua console network protocols are supported). With - ``console = false`` (default), you can also use ``conn`` database methods (in this case, only the binary protocol is - supported). Deprecation notice: ``console = true`` is deprecated, users should use :ref:`console.connect() ` instead. - * ``connect_timeout``: number of seconds to wait before returning "error: Connection timed out". - * ``required_protocol_version``: depending on the value of the option, the connection requires the minimum version - of the IPROTO protocol supported by the server. If the server version is lower than specified, the connection will - fail with an error message. With ``required_protocol_version = 1`` all connections fail where the server protocol is - lower than ``1``. - * ``required_protocol_features``: depending on the value of the option, the connection requires the specified - IPROTO protocol features supported by the server. You can specify one or more ``net.box`` features - from the table below. If the server does not have the specified features, the connection will fail with an error message. - With ``required_protocol_features = {'transactions'}`` all connections fail where the server has ``transaction: false``. + + * ``user/password``: two options to connect to a remote host other than through + :ref:`URI `. For example, instead of ``connect('username:userpassword@localhost:3301')`` + you can write ``connect('localhost:3301', {user = 'username', password='userpassword'})``. + + * ``wait_connected``: a connection timeout. By default, the connection is blocked until the connection + is established, but if you specify ``wait_connected=false``, the connection returns immediately. + If you specify this timeout, it will wait before returning (``wait_connected=1.5`` makes it wait at most 1.5 seconds). + + .. NOTE:: + + If ``reconnect_after`` is greater than zero, then ``wait_connected`` ignores transient failures. + The wait completes once the connection is established or is closed explicitly. + + + * ``reconnect_after``: a number of seconds to wait before reconnecting. + The default value, as with the other ``connect`` options, is ``nil``. If ``reconnect_after`` + is greater than zero, then a ``net.box`` instance will attempt to reconnect if a connection + is lost or a connection attempt fails. This makes transient network failures transparent to the application. + Reconnection happens automatically in the background, so requests that initially fail due to connection drops + fail, are transparently retried. The number of retries is unlimited, connection retries are made after + any specified interval (for example, ``reconnect_after=5`` means that reconnect attempts are made every 5 seconds). + When a connection is explicitly closed or when the Lua garbage collector removes it, then reconnect attempts stop. + + + * ``call_16``: [since 1.7.2] a new binary protocol command for CALL in ``net.box`` connections by default. + The new CALL is not backward compatible with previous versions. It no longer restricts a function to + returning an array of tuples and allows returning an arbitrary MsgPack/JSON result, + including scalars, nil and void (nothing). The old CALL is left intact for backward compatibility. + It will not be present in the next major release. All programming language drivers will gradually be switched + to the new CALL. To connect to a Tarantool instance that uses the old CALL, specify ``call_16=true``. + + * ``console``: an option to use different connection support methods (as if instances of different + classes are returned). With ``console = true`` you can use the ``conn`` methods ``close()``, + ``is_connected()``, ``wait_state()``, ``eval()`` (in this case both binary and Lua console + network protocols are supported). + With ``console = false`` (default) you can also use ``conn`` database methods (in this case only the + binary protocol is supported). Deprecation note: ``console = true`` is deprecated, users should use + :ref:`console.connect() ` instead. + + * ``connect_timeout``: a number of seconds to wait before returning "error: Connection timed out". + + * ``required_protocol_version``: a minimum version of the :ref:`IPROTO protocol ` + supported by the server. If the version of the :ref:`IPROTO protocol ` supported + by the server is lower than specified, the connection will fail with an error message. + With ``required_protocol_version = 1`` all connections fail where the :ref:`IPROTO protocol ` + version is lower than ``1``. + + * ``required_protocol_features``: a specified :ref:`IPROTO protocol features ` supported by the server. + You can specify one or more ``net.box`` features from the table below. If the server does not + support the specified features, the connection will fail with an error message. + With ``required_protocol_features = {'transactions'}`` all connections fail where the + server has ``transactions: false``. .. container:: table @@ -217,23 +226,23 @@ For more options, see the description of ``net_box.new()`` below. * - net.box feature - Use - IPROTO feature ID - - First protocol version with net.box feature + - IPROTO protocol versions with the net.box feature support * - ``streams`` - Requires streams support on the server - IPROTO_FEATURE_STREAMS - - 1 + - 1 and newer * - ``transactions`` - Requires transactions support on the server - IPROTO_FEATURE_TRANSACTIONS - - 1 + - 1 and newer * - ``error_extension`` - Requires support for :ref:`MP_ERROR ` MsgPack extension on the server - IPROTO_FEATURE_ERROR_EXTENSION - - 2 + - 2 and newer * - ``watchers`` - Requires remote watchers support on the server - IPROTO_FEATURE_WATCHERS - - 3 + - 3 and newer To learn more about IPROTO features, see :ref:`IPROTO_ID `. @@ -247,7 +256,7 @@ For more options, see the description of ``net_box.new()`` below. conn = net_box.connect('localhost:3301') conn = net_box.connect('127.0.0.1:3302', {wait_connected = false}) conn = net_box.connect('127.0.0.1:3303', {reconnect_after = 5, call_16 = true}) - conn = net_box.connect('127.0.0.1:3304', {required_protocol_version = 4, required_protocol_features = {'transactions'}, }) + conn = net_box.connect('127.0.0.1:3304', {required_protocol_version = 4, required_protocol_features = {'transactions', 'streams'}, }) .. _net_box-self: From 8e03215fc6cbd4005771fbd7f6a528b63680b2c9 Mon Sep 17 00:00:00 2001 From: Maria Strabykina <102664960+rindblack15@users.noreply.github.com> Date: Thu, 9 Jun 2022 07:16:41 +0300 Subject: [PATCH 11/13] Add commas --- doc/reference/reference_lua/net_box.rst | 60 ++++++++++++------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index d76314baa6..98ead29e26 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -165,12 +165,12 @@ Below is a list of all ``net.box`` functions. :param options: the supported options are shown below: * ``user/password``: two options to connect to a remote host other than through - :ref:`URI `. For example, instead of ``connect('username:userpassword@localhost:3301')`` - you can write ``connect('localhost:3301', {user = 'username', password='userpassword'})``. + :ref:`URI `. For example, instead of ``connect('username:userpassword@localhost:3301')`` + you can write ``connect('localhost:3301', {user = 'username', password='userpassword'})``. * ``wait_connected``: a connection timeout. By default, the connection is blocked until the connection - is established, but if you specify ``wait_connected=false``, the connection returns immediately. - If you specify this timeout, it will wait before returning (``wait_connected=1.5`` makes it wait at most 1.5 seconds). + is established, but if you specify ``wait_connected=false``, the connection returns immediately. + If you specify this timeout, it will wait before returning (``wait_connected=1.5`` makes it wait at most 1.5 seconds). .. NOTE:: @@ -179,43 +179,43 @@ Below is a list of all ``net.box`` functions. * ``reconnect_after``: a number of seconds to wait before reconnecting. - The default value, as with the other ``connect`` options, is ``nil``. If ``reconnect_after`` - is greater than zero, then a ``net.box`` instance will attempt to reconnect if a connection - is lost or a connection attempt fails. This makes transient network failures transparent to the application. - Reconnection happens automatically in the background, so requests that initially fail due to connection drops - fail, are transparently retried. The number of retries is unlimited, connection retries are made after - any specified interval (for example, ``reconnect_after=5`` means that reconnect attempts are made every 5 seconds). - When a connection is explicitly closed or when the Lua garbage collector removes it, then reconnect attempts stop. + The default value, as with the other ``connect`` options, is ``nil``. If ``reconnect_after`` + is greater than zero, then a ``net.box`` instance will attempt to reconnect if a connection + is lost or a connection attempt fails. This makes transient network failures transparent to the application. + Reconnection happens automatically in the background, so requests that initially fail due to connection drops + fail, are transparently retried. The number of retries is unlimited, connection retries are made after + any specified interval (for example, ``reconnect_after=5`` means that reconnect attempts are made every 5 seconds). + When a connection is explicitly closed or when the Lua garbage collector removes it, then reconnect attempts stop. * ``call_16``: [since 1.7.2] a new binary protocol command for CALL in ``net.box`` connections by default. - The new CALL is not backward compatible with previous versions. It no longer restricts a function to - returning an array of tuples and allows returning an arbitrary MsgPack/JSON result, - including scalars, nil and void (nothing). The old CALL is left intact for backward compatibility. - It will not be present in the next major release. All programming language drivers will gradually be switched - to the new CALL. To connect to a Tarantool instance that uses the old CALL, specify ``call_16=true``. + The new CALL is not backward compatible with previous versions. It no longer restricts a function to + returning an array of tuples and allows returning an arbitrary MsgPack/JSON result, + including scalars, nil and void (nothing). The old CALL is left intact for backward compatibility. + It will not be present in the next major release. All programming language drivers will gradually be switched + to the new CALL. To connect to a Tarantool instance that uses the old CALL, specify ``call_16=true``. * ``console``: an option to use different connection support methods (as if instances of different - classes are returned). With ``console = true`` you can use the ``conn`` methods ``close()``, - ``is_connected()``, ``wait_state()``, ``eval()`` (in this case both binary and Lua console - network protocols are supported). - With ``console = false`` (default) you can also use ``conn`` database methods (in this case only the - binary protocol is supported). Deprecation note: ``console = true`` is deprecated, users should use - :ref:`console.connect() ` instead. + classes are returned). With ``console = true``, you can use the ``conn`` methods ``close()``, + ``is_connected()``, ``wait_state()``, ``eval()`` (in this case both binary and Lua console + network protocols are supported). + With ``console = false`` (default), you can also use ``conn`` database methods (in this case only the + binary protocol is supported). Deprecation note: ``console = true`` is deprecated, users should use + :ref:`console.connect() ` instead. * ``connect_timeout``: a number of seconds to wait before returning "error: Connection timed out". * ``required_protocol_version``: a minimum version of the :ref:`IPROTO protocol ` - supported by the server. If the version of the :ref:`IPROTO protocol ` supported - by the server is lower than specified, the connection will fail with an error message. - With ``required_protocol_version = 1`` all connections fail where the :ref:`IPROTO protocol ` - version is lower than ``1``. + supported by the server. If the version of the :ref:`IPROTO protocol ` supported + by the server is lower than specified, the connection will fail with an error message. + With ``required_protocol_version = 1``, all connections fail where the :ref:`IPROTO protocol ` + version is lower than ``1``. * ``required_protocol_features``: a specified :ref:`IPROTO protocol features ` supported by the server. - You can specify one or more ``net.box`` features from the table below. If the server does not - support the specified features, the connection will fail with an error message. - With ``required_protocol_features = {'transactions'}`` all connections fail where the - server has ``transactions: false``. + You can specify one or more ``net.box`` features from the table below. If the server does not + support the specified features, the connection will fail with an error message. + With ``required_protocol_features = {'transactions'}``, all connections fail where the + server has ``transactions: false``. .. container:: table From 36c1443b6d8749004fdee58f8411637550f12ac9 Mon Sep 17 00:00:00 2001 From: Maria Strabykina <102664960+rindblack15@users.noreply.github.com> Date: Thu, 9 Jun 2022 07:43:02 +0300 Subject: [PATCH 12/13] Add require('net.box') to the example --- doc/reference/reference_lua/net_box.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index 98ead29e26..fb2d79ba0c 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -253,6 +253,8 @@ Below is a list of all ``net.box`` functions. .. code-block:: lua + net_box = require('net.box') + conn = net_box.connect('localhost:3301') conn = net_box.connect('127.0.0.1:3302', {wait_connected = false}) conn = net_box.connect('127.0.0.1:3303', {reconnect_after = 5, call_16 = true}) From 6b24d72811d732f452f803bf0a90b98ff6b3cc72 Mon Sep 17 00:00:00 2001 From: Maria Strabykina <102664960+rindblack15@users.noreply.github.com> Date: Fri, 10 Jun 2022 16:06:28 +0300 Subject: [PATCH 13/13] Fix an error --- doc/reference/reference_lua/net_box.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index fb2d79ba0c..8addacdbce 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -211,7 +211,7 @@ Below is a list of all ``net.box`` functions. With ``required_protocol_version = 1``, all connections fail where the :ref:`IPROTO protocol ` version is lower than ``1``. - * ``required_protocol_features``: a specified :ref:`IPROTO protocol features ` supported by the server. + * ``required_protocol_features``: specified :ref:`IPROTO protocol features ` supported by the server. You can specify one or more ``net.box`` features from the table below. If the server does not support the specified features, the connection will fail with an error message. With ``required_protocol_features = {'transactions'}``, all connections fail where the