On 12/18/2013 06:29 PM, Tony Arcieri wrote:
Adding bounds to a channel doesn't require that sends block, and I think
Rust is doing the Right Thing(TM) here in regard to non-blocking sends and
I would never ask you to change that. There are other options for bounding
channels which don't involve a blocking send though:
1) Drop messages on the floor:
2) Crash the sender:
3) Make sends to a full channel an error: ...
Of course there is little difficulty in providing three different
send primitives, and anyway both (1) and (2) can be trivially
constructed from (3), albeit at prohibitive (i.e. one or two cycles!)
cost. I confess that (2) had not occurred to me as a reasonable
alternative. In Rust I assume it would cleanly terminate the task.
Discussion late into the night suggested that fixing channels (in
both senses) is still very much within the charter of post-0.8
development, and I join the chorus of proponents of this change.
For many applications a one-element channel is the right size.
Probably for practically all uses a compile-time-fixed size is
best, and (thus) suffices for a built-in feature.
Nathan Myers
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev