Closed
Description
Product: Tarantool
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/
SME: @ locker
Peer reviewer: @
Details
Two new options can now be passed to net.box.connect(
):
- required_protocol_version: min IPROTO protocol version that must be
supported by the server. Type: unsigned integer. - required_protocol_features: array of IPROTO protocol features that
must be supported by the server. Type: array of strings.
If the server version is less than the specified or the server lacks
certain features, the connection will fail with the corresponding error.
Querying server features is implemented via the IPROTO_ID command.
Currently, there are two features defined: streams and transactions.
Irrespective of the options used, the actual version and features are
reported via peer_protocol_version and peer_protocol_features fields of
the connection. Example:
tarantool> require('net.box').connect(3301, {
> required_protocol_version = 1,
> required_protocol_features = {'transactions'},
> })
---
- peer_protocol_version: 1
peer_uuid: 7a8cfdbd-6bbc-4d10-99e5-cbbd06a2382f
opts:
required_protocol_version: 1
required_protocol_features:
- transactions
peer_protocol_features:
transactions: true
streams: true
schema_version: 80
protocol: Binary
state: active
peer_version_id: 133632
port: '3301'
...
Requested by @locker in tarantool/tarantool@47a85f9