Two-way communication with the new ORC-friendly channels

2022-02-07 Thread PMunch
I'm guessing the isolation just means that Nim can guarantee that you don't have any way to use the data after you've sent it. You've essentially "given" that data to the receiving thread and its GC, if you used it afterwards then it wouldn't be able to reason about when to destroy it. Not entir

Two-way communication with the new ORC-friendly channels

2022-02-06 Thread sekao
With the [current channels implementation](https://nim-lang.org/docs/channels_builtin.html), you can implement a basic request-response system between threads by sending an object over a channel that includes (as one of its fields) a channel for sending the response. For example...