summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorcitycide <lingenbw@gmail.com>2018-10-27 11:52:57 -0500
committerDominik Picheta <dominikpicheta@googlemail.com>2018-10-27 18:04:25 +0100
commit4362ba7293e7527ff57f69bf2a0e95fdfd84985e (patch)
tree648407977419cdcfa7ce9d22e95b5fd4ee46b3af /lib
parentf8cef575b322d9736df369e2a33f5ade7d800f95 (diff)
downloadNim-4362ba7293e7527ff57f69bf2a0e95fdfd84985e.tar.gz
docs: clarify `asyncCheck` vs `waitFor`
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/asyncdispatch.nim4
-rw-r--r--lib/pure/asyncfutures.nim3
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/pure/asyncdispatch.nim b/lib/pure/asyncdispatch.nim
index edd509f50..5ef791cfe 100644
--- a/lib/pure/asyncdispatch.nim
+++ b/lib/pure/asyncdispatch.nim
@@ -145,7 +145,9 @@ export asyncfutures, asyncstreams
 ##
 ## Futures should **never** be discarded. This is because they may contain
 ## errors. If you do not care for the result of a Future then you should
-## use the ``asyncCheck`` procedure instead of the ``discard`` keyword.
+## use the ``asyncCheck`` procedure instead of the ``discard`` keyword. Note
+## however that this does not wait for completion, and you should use
+## ``waitFor`` for that purpose.
 ##
 ## Examples
 ## --------
diff --git a/lib/pure/asyncfutures.nim b/lib/pure/asyncfutures.nim
index df0e7c17e..965e70055 100644
--- a/lib/pure/asyncfutures.nim
+++ b/lib/pure/asyncfutures.nim
@@ -339,7 +339,8 @@ proc asyncCheck*[T](future: Future[T]) =
   ## Sets a callback on ``future`` which raises an exception if the future
   ## finished with an error.
   ##
-  ## This should be used instead of ``discard`` to discard void futures.
+  ## This should be used instead of ``discard`` to discard void futures,
+  ## or use ``waitFor`` if you need to wait for the future's completion.
   assert(not future.isNil, "Future is nil")
   future.callback =
     proc () =