{
my $cv = AE::cv();
$cv->begin for (@shards);
$_->start($cv) for (@shards);
$cv->recv;
}
{
$_->sync_start() for (@shards);
}
{
my ($status, $reason) = $shards[0]->sync_ro();
die $reason unless $status;
print (($shards[0]->sync_admin_cmd("show info"))[1]);
}
# Some test case here
$shards[1]->pause();
# Some test case here
$shards[1]->resume();
{
my ($status, $reason) = $shards[0]->sync_rw();
die $reason unless $status;
print (($shards[0]->sync_admin_cmd("show info"))[1]);
}
# stop tarantools and clear work directoies
@shards = ();
SUBROUTINES/METHODS
new option => value,...
Create new Tarantool instance. Every call of new method increase counter,
below called as tarantool number or tn.
root => $path
The tarantool work directory, created if not exists. Default is
./tnt_<10_random_lowercase_letters>
arena => $size
The maximal size of tarantool arena in Gb. Default is 0.1
cleanup => $bool
Remove the tarantool work directory after the garbage collection.
Default is 1
spaces => $string
Tarantool spaces description. This is only one required argument.
initlua => $content
Content of init.lua file. Be default an empty file created.
host => $address
Address bind to. Default: 127.0.0.1
port => $port
Primary port number, base for s_port, a_port and r_port.
Default is 6603+<tn>*4
s_port => $port
Read-only (secondary) port. Default is port+1
a_port => $port
Admin port. Default is port+2
r_port => $port
Replication port. Default is port+3
title => $title
Part of process name (custom_proc_title) Default is "yat<tn<"
wal_mode => $mode
The WAL write mode. See the desctiption of wal_mode tarantool
variable. Default is none. Look more about wal_mode in tarantool
documentation.
log_level => $number
Tarantool log level. Default is 5
snapshot => $path
Path to some snapshot. If given the symbolic link to it will been
created in tarantool work directory.
replication_source => $string
If given the server is considered to be a Tarantool replica.
logger => $sub
An subroutine called at every time, when tarantool write some thing
in a log. The writed text passed as the first argument. Default is
warn.
on_die => $sub
An subroutine called on a unexpected tarantool termination.
start option => $value, $cb->($status, $reason)
Run tarantool instance.
timeout => $timeout
If not After $timeout seconds tarantool will been kelled by the KILL
signal if not started.