Add cancellation handler for cancelAndWait()

This commit is contained in:
cheatfate 2020-11-17 12:04:19 +02:00 committed by zah
parent 493cb1dbfd
commit 879c917242

View File

@ -804,6 +804,7 @@ proc cancelAndWait*[T](fut: Future[T]): Future[void] =
retFuture.complete()
else:
fut.addCallback(continuation)
retFuture.cancelCallback = cancellation
# Initiate cancellation process.
fut.cancel()
return retFuture