complete On Timeout
Completes this CompletableFuture with the given value if not otherwise completed before the given timeout.
CAUTION: This method and CompletableFuture.completeOnTimeout is UNSAFE!
When triggered by timeout, the subsequent non-async actions of the dependent CompletableFutures are performed in the SINGLE thread builtin executor of CompletableFuture for delay execution (including timeout function). So the long-running subsequent non-async actions lead to the CompletableFuture dysfunction (including delay execution and timeout).
Strong recommend using the safe method cffuCompleteOnTimeout instead of this method and CompletableFuture.completeOnTimeout.
Unless all subsequent actions of dependent CompletableFutures is ensured executing async (aka. the dependent CompletableFutures is created by async methods), using this method and CompletableFuture.completeOnTimeout is one less thread switch of task execution when triggered by timeout.
Return
this CompletableFuture
Parameters
the value to use upon timeout
how long to wait before completing normally with the given value, in units of unit
a TimeUnit
determining how to interpret the timeout
parameter