about summary refs log tree commit diff stats
path: root/cpp/053scenario_trace_test.mu
Commit message (Expand)AuthorAgeFilesLines
* 1077Kartik K. Agaram2015-04-171-0/+1
* 1075Kartik K. Agaram2015-04-171-0/+27
/a> 14 15 16 17 18 19


















                                  
import asyncdispatch

var fs = newFutureStream[string]()

proc alpha() {.async.} =
  for i in 0 .. 5:
    fs.put($i)
    await sleepAsync(1000)

  fs.complete()

proc beta() {.async.} =
  while not fs.finished():
    echo(await fs.takeAsync())

  echo("Finished")

asyncCheck alpha()
asyncCheck beta()