Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import actors
- proc secondActor(self: PActor[int,int]): void {.thread.} =
- while true:
- var task = self.recv()
- if task.shutDown:
- echo "Received Shutdown!!"
- return
- echo task.receiver == nil
- proc firstActor(self: PActor[int,int]) : void {.thread.} =
- var actor = spawn[int, int](secondActor)
- actor.send(10, self)
- actor.sendShutDown()
- actor.join()
- var actor = spawn[int, int](firstActor)
- actor.join()
Advertisement
Add Comment
Please, Sign In to add comment