4 ms·
I commented on that here: http://dustin.github.com/2009/11/12/gomemcached.html#comment-22883032 http://dustin.github.com/2009/11/12/gomemcached.html#comment...
by dlsspy 17y ago
I commented on that here: http://dustin.github.com/2009/11/12/gomemcached.html#comment-22883032 http://dustin.github.com/2009/11/12/gomemcached.html#comment...
Basically, it's about allowing me to express my sequence of writes without wrapping each one in an if block.
I could have also done something like
return write(x) && write(y) [...]
or
return write(x, y, ...)
but all I really want is to stop writing when a write fails and have the goroutine exit.
I've seen a couple people suggest using a channel for this. Containing the write within an object of sorts to contain that boolean would do roughly the same thing. I'd still need to somehow unwind the stack quickly to even know that that channel has something waiting on it.