Last active
August 9, 2018 22:45
-
-
Save NaelsonDouglas/4ab0a1fcdb1100c159e0c057e064116f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function producer() | |
ch = Channel{Any}(1) | |
@async begin | |
for i=1:5 | |
put!(ch,i) | |
end | |
close(ch) | |
end | |
return ch | |
end | |
ch = producer() | |
take!(ch) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment