bugfix: codegen for promises
This commit is contained in:
parent
e6d12f3f6e
commit
b78173788d
3 changed files with 13 additions and 5 deletions
|
|
@ -151,7 +151,7 @@ proc await*[T](prom: Promise[T]) =
|
|||
if prom.usesCondVar: await(prom.cv)
|
||||
|
||||
proc awaitAndThen*[T](prom: Promise[T]; action: proc (x: T) {.closure.}) =
|
||||
## blocks until the value is available and then passes this value
|
||||
## blocks until the ``prom`` is available and then passes its value
|
||||
## to ``action``. Note that due to Nimrod's parameter passing semantics this
|
||||
## means that ``T`` doesn't need to be copied and so ``awaitAndThen`` can
|
||||
## sometimes be more efficient than ``^``.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue