cycle breaker (#13593)

* cycle breaking as an alternative to cycle detection
This commit is contained in:
Andreas Rumpf 2020-03-19 22:58:16 +01:00 • committed by GitHub
commit 35fb38629f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 298 additions and 41 deletions

View file

@ -382,7 +382,7 @@ proc read*[T](future: Future[T] | FutureVar[T]): T =
injectStacktrace(fut)
raise fut.error
when T isnot void:
return fut.value
result = fut.value
else:
# TODO: Make a custom exception type for this?
raise newException(ValueError, "Future still in progress.")