mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
16 lines
325 B
Nim
16 lines
325 B
Nim
discard """
|
|
exitcode: 0
|
|
output: "hello world"
|
|
disabled: windows
|
|
"""
|
|
|
|
import asyncdispatch
|
|
import asyncfile
|
|
|
|
var asyncStdout = 1.AsyncFD.newAsyncFile()
|
|
proc doStuff: Future[void] {.async.} =
|
|
await asyncStdout.write "hello world\n"
|
|
|
|
let fut = doStuff()
|
|
doAssert fut.finished, "Poll is needed unnecessarily. See #6846."
|