Doc / Module cartridge.pool

Module cartridge.pool

Module cartridge.pool

Connection pool.

Reuse tarantool net.box connections with ease.

Functions

connect (uri[, opts])

Connect a remote or get cached connection. Connection is established using net.box.connect() .

Parameters:

Returns:

net.box connection

Or

(nil)

(table) Error description

Local Functions

format_uri (uri)

Enrich URI with credentials. Suitable to connect other cluster instances.

Parameters:

Returns:

(string) username:password@host:port

map_call (fn_name[, args[, opts]])

Perform a remote call to multiple URIs and map results.

(Added in v1.2.0-17)

Parameters:

  • fn_name: (string)

  • args: (table) function arguments (optional)

  • opts:

    • uri_list: ({string,…}) array of URIs for performing remote call

    • timeout: (optional number) passed to net.box conn:call()

Returns:

({URI=value,…}) Call results mapping for every URI.

(nil or {URI=error,…}) Errors mapping for every URI.