mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
26 lines
442 B
Nim
26 lines
442 B
Nim
discard """
|
|
output: "1"
|
|
"""
|
|
|
|
import actors
|
|
|
|
type
|
|
some_type {.pure, final.} = object
|
|
bla: int
|
|
|
|
proc thread_proc(input: some_type): some_type {.thread.} =
|
|
result.bla = 1
|
|
|
|
proc main() =
|
|
var actorPool: TActorPool[some_type, some_type]
|
|
createActorPool(actorPool, 1)
|
|
|
|
var some_data: some_type
|
|
|
|
var inchannel = spawn(actorPool, some_data, thread_proc)
|
|
var recv_data = ^inchannel
|
|
close(inchannel[])
|
|
echo recv_data.bla
|
|
|
|
main()
|