I was so confused to understand behaviior of Golang channels, buffer, blocking, deadlocking and groutines.
I read Go by Example topics.
| class Hoge | |
| class InvalidBlockError < StandardError; end | |
| attr_accessor :result, :error | |
| # 渡されたブロックを実行して、結果をプロパティに格納するインスタンスメソッド。 | |
| def call | |
| yield | |
| self.result = :success | |
| rescue => e |
_,'| _.-''``-...___..--';)
/_ \'. __..-' , ,--...--'''
<\ .`--''' ` /'
`-';' ; ; ;
__...--'' ___...--_..' .;.'
(,__....----''' (,..--''
To enable cat cat, place the above text in a file titled cat. Image by Felix Lee, from http://user.xmission.com/~emailbox/ascii_cats.htm