mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-18 23:11:36 +00:00
progress with futures
This commit is contained in:
17
tests/parallel/tflowvar.nim
Normal file
17
tests/parallel/tflowvar.nim
Normal file
@@ -0,0 +1,17 @@
|
||||
discard """
|
||||
output: '''foobarfoobarbazbearbazbear'''
|
||||
cmd: "nimrod $target --threads:on $options $file"
|
||||
"""
|
||||
|
||||
import threadpool
|
||||
|
||||
proc computeSomething(a, b: string): string = a & b & a & b
|
||||
|
||||
proc main =
|
||||
let fvA = spawn computeSomething("foo", "bar")
|
||||
let fvB = spawn computeSomething("baz", "bear")
|
||||
|
||||
echo(^fvA, ^fvB)
|
||||
|
||||
main()
|
||||
sync()
|
||||
@@ -1,6 +1,6 @@
|
||||
discard """
|
||||
line: 7
|
||||
errormsg: "'spawn' takes a call expression of type void"
|
||||
errormsg: "'spawn' takes a call expression"
|
||||
cmd: "nimrod $target --threads:on $options $file"
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user