asynctnt.connection
Module Contents
Classes
Enum where members are also (and must be) ints |
|
Functions
|
connect shorthand. See |
- class asynctnt.connection.ConnectionState[source]
Bases:
enum.IntEnum
Enum where members are also (and must be) ints
- class asynctnt.connection.Connection(*, host: str = '127.0.0.1', port: int | str = 3301, username: str | None = None, password: str | None = None, fetch_schema: bool = True, auto_refetch_schema: bool = True, connect_timeout: float = 3.0, request_timeout: float = -1.0, reconnect_timeout: float = 1.0 / 3.0, ping_timeout: float = 5.0, encoding: str | None = None, initial_read_buffer_size: int | None = None)[source]
Bases:
asynctnt.api.Api
- property state: ConnectionState[source]
Current connection state
- Return type:
- property is_fully_connected: bool[source]
Check if connection is fully active (performed auth and schema fetching)
- property schema: asynctnt.iproto.protocol.Schema | None[source]
Current Tarantool schema with all spaces, indexes and fields
- property features: asynctnt.iproto.protocol.IProtoFeatures[source]
Lookup available Tarantool features - https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_iproto/feature/ :return:
- __slots__ = ('_host', '_port', '_username', '_password', '_fetch_schema', '_auto_refetch_schema',...[source]
- _set_state(new_state: ConnectionState)[source]
- protocol_factory(connected_fut: asyncio.Future, loop: asyncio.AbstractEventLoop, cls: Type[asynctnt.iproto.protocol.Protocol] = protocol.Protocol)[source]
- async connect() Connection [source]
Connect coroutine
- close()[source]
Same as disconnect, but not a coroutine, i.e. it does not wait for disconnect to finish.
- async __aenter__() Connection [source]
Executed on entering the async with section. Connects to Tarantool instance.
- async __aexit__(exc_type, exc_val, exc_tb)[source]
Executed on leaving the async with section. Disconnects from Tarantool instance.
- stream() asynctnt.stream.Stream [source]
Create new stream suitable for interactive transactions
- async asynctnt.connection.connect(**kwargs) Connection [source]
connect shorthand. See
asynctnt.Connection
for kwargs details- Returns:
asynctnt.Connection
object