Anonymous user
Synchronous concurrency: Difference between revisions
Updated to work with Nim 1.4: replaced “nil” with “""” and “msg == nil” with “msg.len == 0”. Also, removed the explicit opening and closing of the file.
(→Using coroutines: Use forEachLine over useLines; No need to close the file.) |
(Updated to work with Nim 1.4: replaced “nil” with “""” and “msg == nil” with “msg.len == 0”. Also, removed the explicit opening and closing of the file.) |
||
Line 1,715:
proc read() {.thread.} =
msgs.send(line)
msgs.send(
echo count.recv()
count.close()
Line 1,727 ⟶ 1,725:
while true:
var msg = msgs.recv()
if msg.len ==
break
echo msg
|