Skip to content

Instantly share code, notes, and snippets.

@alehander92 alehander92/a.nim
Created Mar 26, 2020

Embed
What would you like to do?
proc pushOrSend[Input, Output](queue: AsyncQueue[Input, Output], input: Input): Future[Output] =
var future = newFuture[Output]("pushOrSend " & $input)
queue.list.addFirst(input)
queue.futures.addFirst(future)
if not queue.running:
await queue.run()
return future
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.