I have the following code
import threadpool
type
  Person = object
    name: string
    age: int
proc worker(): Person =
  return Person(name: "john", age: 42)
proc main() =
  
  for i in 0 .. 10:
    var t = spawn worker()
    echo type(t)
  
  sync()
main()
And I have compiled with
nim c -r --threads:on test.nim
But I get Error: cannot create a flowVar of type: Person. I've tried using object and tuple but I still get the same error. Is there a way to do this or am I doing something wrong?
import threadpool
type
  Person = ref object
    name: string
    age: int
proc worker(): Person =
  return Person(name: "john", age: 42)
proc main() =
  
  for i in 0 .. 10:
    var t = spawn worker()
    echo type(t)
  
  sync()
main()Prints FlowVar[Person], I hope is what you needed...