Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the experimental.connpool module #4129

Closed
Tracked by #4294
TarantoolBot opened this issue Apr 4, 2024 · 0 comments · Fixed by #4329
Closed
Tracked by #4294

the experimental.connpool module #4129

TarantoolBot opened this issue Apr 4, 2024 · 0 comments · Fixed by #4329
Assignees

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Apr 4, 2024

Related dev. issue(s): tarantool/tarantool#9842
Related doc. issue(s): #4151, #4156

Product: Tarantool
Since: 3.1
Root document:

Related cartridge docs:

SME: @ ImeevMA

Details

The experimental.connpool module contains some functions that allow you
to retrieve the names of instances from the configuration that satisfy
specified conditions, or to execute a function on one of these
instances. Additionally, this module has a function that returns the
active connection to the instance with the specified name.

Currently this module contains three functions:

  1. connect() takes an instance name and options and returns the active
    connection to the instance with the specified name. The
    connect_timeout and fetch_schema options are passed directly to
    net.box.connect(). The wait_connected option is also passed to
    net.box.connect(), but here it can be true or false, numeric
    values are not allowed.
  2. filter() accepts only options as its only argument. It returns an
    array of instance names that match the provided options. Currently only
    two options are supported:
    a) labels that instances must have ( New labels in config schema #4096)
    b) roles that instances must have ( Roles #3702)
  3. call takes the name of the function to execute, arguments for this
    function, and options. The labels and roles options are used to
    select candidates on which the function will be executed. If the
    prefer_local option is false, call will try to connect to a random
    candidate until a connection is established or there are no more
    candidates. If the prefer_local option is true or nil and the instance
    in which call is executed is one of the candidates, call will
    attempt to connect to that instance first. Moreover, call has options
    timeout, buffer, on_push, on_push_ctx and is_async, which are
    passed directly to net.box.call(). Note that the connection option
    works for the net.box.call() part. The potential maximum execution
    time is <number of candidates> * <default connect_timeout for net.box.connect()> + connection.
    Requested by @ ImeevMA in tarantool/tarantool@9355933.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants