From 357baa52a0ea3da699c8229d97230c7f4340da92 Mon Sep 17 00:00:00 2001 From: cheatfate Date: Tue, 21 Apr 2020 07:33:31 +0300 Subject: [PATCH] Fix documentation for `or`. --- chronos/asyncfutures2.nim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chronos/asyncfutures2.nim b/chronos/asyncfutures2.nim index c222788..28597b0 100644 --- a/chronos/asyncfutures2.nim +++ b/chronos/asyncfutures2.nim @@ -494,8 +494,13 @@ proc `or`*[T, Y](fut1: Future[T], fut2: Future[Y]): Future[void] = ## Returns a future which will complete once either ``fut1`` or ``fut2`` ## complete. ## - ## If ``fut1`` or ``fut2`` will fail, result future will also fail with an - ## error stored in ``fut1`` or ``fut2`` respectively. + ## If ``fut1`` or ``fut2`` future is failed, the result future will also be + ## failed with an error stored in ``fut1`` or ``fut2`` respectively. + ## + ## If both ``fut1`` and ``fut2`` future are completed or failed, the result + ## future will depend on the state of ``fut1`` future. So if ``fut1`` future + ## is failed, the result future will also be failed, if ``fut1`` future is + ## completed, the result future will also be completed. ## ## If cancelled, ``fut1`` and ``fut2`` futures WILL NOT BE cancelled. var retFuture = newFuture[void]("chronos.or")