mirror of
https://github.com/status-im/nim-chronos.git
synced 2025-01-18 23:31:13 +00:00
Add cancellation handler for cancelAndWait()
This commit is contained in:
parent
493cb1dbfd
commit
879c917242
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user