| 1 | 3 | ▶ | use utf8; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | package DR::Tnt; | ||||||||||||
| 6 | 3 | ▶ | use base qw(Exporter); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 3 | our $VERSION = '0.21'; | |||||||||||
| 8 | 3 | our @EXPORT = qw(tarantool); | |||||||||||
| 9 | 3 | ▶ | use List::MoreUtils 'any'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | 3 | ▶ | use Carp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | 3 | $Carp::Internal{ (__PACKAGE__) }++; | |||||||||||
| 13 | |||||||||||||
| 14 | sub tarantool { | ||||||||||||
| 15 | 0 | ▶ | my (%opts) = @_; | ||||||||||
|
Subroutine
tarantool: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 16 | |||||||||||||
| 17 | 0 | ▶ | my $driver = delete($opts{driver}) || 'sync'; | ||||||||||
|
Condition0%0/2
delete $opts{'driver'} || 'sync'
MC/DC0%0/1
delete $opts{'driver'} || 'sync'
delete $opts{'driver'}
Truth table0%0/2
A
A= delete $opts{'driver'}
| |||||||||||||
| 18 | |||||||||||||
| 19 | 0 | ▶ | unless (any { $driver eq $_ } 'sync', 'ae', 'async', 'coro') { | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
| |||||||||||||
| 20 | 0 | goto usage; | |||||||||||
| 21 | } | ||||||||||||
| 22 | |||||||||||||
| 23 | |||||||||||||
| 24 | 0 | goto $driver; | |||||||||||
| 25 | 0 | sync: | |||||||||||
| 26 | require DR::Tnt::Client::Sync; | ||||||||||||
| 27 | 0 | return DR::Tnt::Client::Sync->new(%opts); | |||||||||||
| 28 | |||||||||||||
| 29 | 0 | ae: | |||||||||||
| 30 | async: | ||||||||||||
| 31 | 0 | require DR::Tnt::Client::AE; | |||||||||||
| 32 | 0 | return DR::Tnt::Client::AE->new(%opts); | |||||||||||
| 33 | |||||||||||||
| 34 | 0 | coro: | |||||||||||
| 35 | require DR::Tnt::Client::Coro; | ||||||||||||
| 36 | 0 | return DR::Tnt::Client::Coro->new(%opts); | |||||||||||
| 37 | |||||||||||||
| 38 | |||||||||||||
| 39 | 0 | usage: | |||||||||||
| 40 | croak "Too few information about tarantool connection"; | ||||||||||||
| 41 | } | ||||||||||||
| 42 | |||||||||||||
| 43 | 3 | 1; | |||||||||||
| 44 | |||||||||||||
| 45 | __END__ | ||||||||||||