asynctnt.instance

Module Contents

Classes

TarantoolInstanceProtocol

Interface for protocol for subprocess calls.

TarantoolInstance

TarantoolSyncInstance

TarantoolAsyncInstance

TarantoolSyncDockerInstance

class asynctnt.instance.TarantoolInstanceProtocol(tnt, on_exit)[source]

Bases: asyncio.SubprocessProtocol

Interface for protocol for subprocess calls.

property logger[source]
property pid[source]
property returncode[source]
connection_made(transport)[source]

Called when a connection is made.

The argument is the transport representing the pipe connection. To receive data, wait for data_received() calls. When the connection is closed, connection_lost() is called.

pipe_data_received(fd, data)[source]

Called when the subprocess writes data into stdout/stderr pipe.

fd is int file descriptor. data is bytes object.

process_exited()[source]

Called when subprocess has exited.

async wait()[source]

Wait until the process exit and return the process return code.

This method is a coroutine.

send_signal(signal)[source]
terminate()[source]
kill()[source]
class asynctnt.instance.TarantoolInstance(*, host='127.0.0.1', port=3301, console_host=None, console_port=3302, replication_source=None, title=None, logger=None, log_level=5, slab_alloc_arena=0.1, wal_mode='none', root=None, specify_work_dir=True, cleanup=True, initlua_template=None, applua='-- app.lua --', extra_box_cfg='', timeout=5.0, command_to_run='tarantool', command_args=None)[source]
property replication_source[source]
property logger[source]
property fingerprint[source]
property host[source]
property port[source]
property console_port[source]
property is_running[source]
abstract property pid[source]
_random_string(length, *, source=string.ascii_uppercase + string.ascii_lowercase + string.digits)[source]
_generate_title()[source]
_generate_root_folder_name()[source]
static get_random_port()[source]
_create_initlua_template()[source]
_render_initlua()[source]
_save_initlua(initlua)[source]
prepare(recreate)[source]
abstract command(cmd, print_greeting=True)[source]
abstract start(*, wait=True, recreate=True)[source]
abstract stop()[source]
abstract terminate()[source]
abstract kill()[source]
cleanup()[source]
class asynctnt.instance.TarantoolSyncInstance(**kwargs)[source]

Bases: TarantoolInstance

property pid[source]
property bin_version: tuple | None[source]
WAIT_TIMEOUT = 5[source]
__enter__()[source]
__exit__(exc_type, exc_val, exc_tb)[source]
start(*, wait=True, recreate=True)[source]
_log_reader()[source]
stop()[source]
terminate()[source]
kill()[source]
_wait(timeout, wait=True)[source]
cleanup()[source]
static _parse_version(version: str) tuple | None[source]
version() tuple | None[source]
command(cmd, print_greeting=True)[source]
class asynctnt.instance.TarantoolAsyncInstance(**kwargs)[source]

Bases: TarantoolInstance

property pid[source]
prepare(recreate)[source]
_on_process_exit(return_code)[source]
async wait_stopped()[source]
async version()[source]
async command(cmd, print_greeting=True)[source]
async start(*, wait=True, recreate=True)[source]
async stop()[source]
terminate()[source]
kill()[source]
cleanup()[source]
class asynctnt.instance.TarantoolSyncDockerInstance(*, docker_image=None, docker_tag=None, host='0.0.0.0', port=3301, console_host=None, console_port=3302, replication_source=None, title=None, logger=None, log_level=5, slab_alloc_arena=0.1, wal_mode='none', initlua_template=None, applua='-- app.lua --', timeout=10.0)[source]

Bases: TarantoolSyncInstance

property bin_version: tuple | None[source]