Description
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.