Home
Random
Log in
Settings
About Rosetta Code
Disclaimers
Rosetta Code
Search
Synchronous concurrency: Difference between revisions
Page
Discussion
← Older edit
Newer edit →
Synchronous concurrency
(view source)
Revision as of 21:57, 3 January 2020
49 bytes removed
,
4 years ago
m
→{{header|Crystal}}
Revision as of 21:41, 3 January 2020
(
view source
)
rosettacode>Codingconcepts
(
→{{header|Crystal}}
)
← Older edit
Revision as of 21:57, 3 January 2020
(
view source
)
rosettacode>Codingconcepts
m
(
→{{header|Crystal}}
)
Newer edit →
Line 684:
<lang ruby>File.write("input.txt", "a\nb\nc")
lines = Channel(String).new
spawn do
File.each_line("input.txt") do |line|
Line 693:
lines.close
end
while
line = lines.receive
?
▼
begin
puts line
▼
while
▲
line = lines.receive
▲
puts line
end
rescue ex : Channel::ClosedError
end
Anonymous user
rosettacode>Codingconcepts