Skip to content

Instantly share code, notes, and snippets.

@dom96

dom96/foo.nim Secret

Created April 26, 2016 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dom96/4046cf5ee677cbae1c069bc734b8cca6 to your computer and use it in GitHub Desktop.
Save dom96/4046cf5ee677cbae1c069bc734b8cca6 to your computer and use it in GitHub Desktop.
import asyncdispatch
proc main() {.async.} =
var fut = newFuture[void]("blah")
fut.complete()
doAssert(fut.finished)
await(fut)
FutureVar[void](fut).clean()
fut.cb = proc () = discard
doAssert(not finished(fut))
fut.complete()
doAssert(finished(fut))
waitFor main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment