Skip to content

popen: :wait() now has the timeout parameter #4174

Closed
@TarantoolBot

Description

@TarantoolBot

Related dev. issue(s): tarantool/tarantool#4915, tarantool/tarantool#7653, tarantool/tarantool#4916

Product: Tarantool
Since: 3.2
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/popen/#popen-wait
SME: @ Totktonada

Details

Usage example:

local ph = popen.new(<...>)
local res, err = ph:wait({timeout = 1})

if res == nil then
    -- Timeout is reached.
    assert(err.type == 'TimedOut')
    <...>
end

Also :wait() now has defined behavior when the popen handle is closed
from another fiber: the method returns the ChannelIsClosed error.

Both updates should have 'Since X.Y.Z' marks in the documentation to
allow users to decide whether to use the new features based on what
tarantool releases should be supported by the calling code. IOW, a user
may lean on the defined close-during-wait behavior or decide to don't.
The same is true for the new timeout option.

See the lbox_popen_wait() comment for the updated formal description
of the <popen handle>:wait(<...>) method.
Requested by @ Totktonada in tarantool/tarantool@735b0dc.

Metadata

Metadata

Assignees

Labels

3.2reference[location] Tarantool manual, Reference part

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions