Created
July 19, 2016 06:28
-
-
Save maiha/61c4446a05afec95763f2b43f34faf0a to your computer and use it in GitHub Desktop.
Crystal lang tips
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
# https://github.com/crystal-lang/crystal/issues/2990#issuecomment-232775971 | |
spawn do | |
sleep 10 | |
ch.close | |
end | |
spawn do | |
sleep 20 | |
ch.send 1 # => Exception | |
end | |
res = ch.receive rescue "timeouted" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment