# Pastebin 41ADG9Iv template pollFlowVar[T](flowVar: FlowVar[T], body: untyped): untyped = ## Handler for checking the result of a flowVar inside of an async proc. while true: # Check if the spawn FlowVar has finished. if flowVar.isReady(): # If so, execute the handler body. body else: # Otherwise, yield in order to return control back to the main event loop. yield sleepAsync 1