Thoughts on this idea for a new `select!` syntax in crossbeam-channel? select! { recv(r, msg) => {} // `msg` is of type `Result<T, RecvError>` send(s, msg) => {} default(Duration::from_secs(1)) => {} } The Go equivalent is in the next tweet.
In that case, what should sending a message into a closed channel do? Channels in Go panic, while the chan crate simply leaks the message. The latter is worse, IMO, since that just silently ignores the error.
-
-
I like the idea of a panic. (An additional API that returns an error might be a good idea too.)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.