---
name: "DR::Tarantool::CoroClient"
section: "3pm"
platform: "linux"
package: "libdr-tarantool-perl"
version: "0.45-2+b2"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/DR::Tarantool::CoroClient"
---

# DR::Tarantool::CoroClient(3pm)

an asynchronous coro driver for Tarantool \<http://tarantool.org\>

## NAME

DR::Tarantool::CoroClient - an asynchronous coro driver for Tarantool \<http://tarantool.org\>

## SYNOPSIS

```
    use DR::Tarantool::CoroClient;
    use Coro;
    my $client = DR::Tarantool::CoroClient->connect(
        port    => $port,
        spaces  => $spaces;
    );
    my @res;
    for (1 .. 100) {
        async {
            push @res => $client->select(space_name => $_);
        }
    }
    cede while @res < 100;
```

## METHODS

### connect

Connects to Tarantool.

*Arguments*

The same as "connect" in DR::Tarantool::AsyncClient, excluding the callback.

Returns a connection handle or croaks an error.

*Additional arguments*

- raise\_error

  If **true** (default behaviour) the driver throws an exception for each server error.

### ping

The same as "ping" in DR::Tarantool::AsyncClient, excluding the callback.

Returns **true** on success, **false** on error.

### insert

The same as "insert" in DR::Tarantool::AsyncClient, excluding the callback.

Returns the inserted tuple or undef. Croaks an error if insert failed (**raise\_error** must be set).

### select

The same as "select" in DR::Tarantool::AsyncClient, excluding the callback.

Returns tuple or tuples that match selection criteria, or undef if no matching tuples were found. Croaks an error if an error occurred (provided **raise\_error** is set).

### update

The same as "update" in DR::Tarantool::AsyncClient, excluding the callback.

Returns the new value of the tuple. Croaks an error if update failed (provided **raise\_error** is set).

### delete

The same as "delete" in DR::Tarantool::AsyncClient, excluding the callback.

Returns the deleted tuple, or undef. Croaks error if an error occurred (provided **raise\_error** is set).

### call\_lua

The same as "call\_lua" in DR::Tarantool::AsyncClient, excluding the callback.

Returns a tuple or tuples returned by the called procedure. Croaks an error if an error occurred (provided **raise\_error** is set).
