wait

Wait for the Future instances given by $(PARAM futures) to complete.

wait
(
Future
)
if (
is(Future : FutureHandle)
)

Parameters

eventLoop EventLoop

event loop, $(D_PSYMBOL getEventLoop) if not specified.

futures Future[]

futures to wait for.

timeout Duration

can be used to control the maximum number of seconds to wait before returning. If $(PARAM timeout) is 0 or negative there is no limit to the wait time.

returnWhen ReturnWhen

indicates when this function should return. It must be one of the following constants: FIRST_COMPLETED The function will return when any future finishes or is cancelled. FIRST_EXCEPTION The function will return when any future finishes by raising an exception. If no future raises an exception then it is equivalent to ALL_COMPLETED. ALL_COMPLETED The function will return when all futures finish or are cancelled.

Return Value

Type: auto

a named 2-tuple of arrays. The first array, named $(D_PSYMBOL done), contains the futures that completed (finished or were cancelled) before the wait completed. The second array, named $(D_PSYMBOL notDone), contains uncompleted futures.

Meta