Closed jcrevier closed 7 months ago
Yes, I believe it should be possible to add these methods by just forwarding them from the Core
type; not having them on MPSC channels was just an oversight on my part, I think. I'd happily merge a PR that adds them!
Just wanted to give this a quick bump - the PR looks to be in decent shape. If there is anything I can do to help get it merged, let me know - as it would be very useful for one of my projects!
@kiranshila so I think the only real blocker is that there's some weird behavior around the len() method that merging this PR would expose -- I think when dropping the channel. See the failing doc tests in the PR. Eliza was going to look into it, and I was also going to try to look into it..I haven't had the time and I suspect the same for Eliza.
Glad to see this merged 😄 🎉
Hello! This crate is very neat. It would be very helpful for metrics if
mpsc::Sender
andmpsc::Receiver
channel handles exposed a way to determine the capacity and remaining slots. TheThingBuf
queue has aremaining()
and acapacity()
method, so it seems odd that Sender or Receiver don't. I'm open to writing up a PR to add this, but I noticed that the implementation of Sender and Receiver was a bit different thanThingBuf
-- is there any reason these weren't exposed? From a quick glance it seems like they would be easy to add toSender
andReceiver
by just using thelen()
andcapacity()
methods fromself.inner.core.core