Closed elinorbgr closed 9 years ago
It would be nice if the Notify implementation were optional. I guess that most applications can use their own implementation of a message queue, and they only need the os::Awakener
object.
@vberger the easy fix would be to just vendor mpmc_bounded_queue.
@ayosec I don't follow. Why would it be nice if the notify implementation were optional? Is there overhead to having it? I assume you mean the generic? My guess is that the ergonomics of the API will go away with associated types & type defaults.
I don't follow. Why would it be nice if the notify implementation were optional?
I think that the feature is really useful. My only concern is that the current implementation uses a fixed-size queue. If the server receives an unexpected peak, I guess that the new connections have to be dropped.
Ah, yes, I plan to make the queue pluggable. However, IMO one should always use a bounded queue. When you use an unbounded queue, you are really just using a bounded queue w/ an unknown cap (hitting OOM) and not being able to sanely handle reaching those limits.
Creating a queue w/ 2MM entries would plausibly take less than 10MB RAM.
But anyway, like I said, I would like the queue to be pluggable eventually.
Following https://github.com/rust-lang/rust/pull/19274,
mpmc_bounded_queue
is no longer in the libstd public API of Rust.Thus mio does no longer compile on last Rust and I don't see any immediate fix.