Jump to content
Main menu
Main menu
move to sidebar
hide
Social
Discord
Facebook
Twitter
Explore
Languages
Tasks
Random page
Rosetta Code
Search
Search
Create account
Log in
Personal tools
Dark mode
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Synchronous concurrency: Difference between revisions
Page
Discussion
English
Read
View source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
View source
View history
Refresh
General
Special pages
Printable version
Get shortened URL
← 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
Cookies help us deliver our services. By using our services, you agree to our use of cookies.
More information
OK
Toggle limited content width