-
Notifications
You must be signed in to change notification settings - Fork 208
De-monomorphize spsc consumer and producer #571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
De-monomorphize spsc consumer and producer #571
Conversation
970035f
to
e4c5b81
Compare
This is a breaking change, but if we yank 0.9.0 as I suggest to do in #568 , it would be nice to have it in the next release. |
9790bcf
to
53bb179
Compare
This needs a workaround for the `const` use case however
53bb179
to
e282e0a
Compare
@@ -464,8 +597,8 @@ impl<T, S: Storage> QueueInner<T, S> { | |||
/// consumer.dequeue().unwrap(); | |||
/// } | |||
/// ``` | |||
pub const fn split(&mut self) -> (ProducerInner<'_, T, S>, ConsumerInner<'_, T, S>) { | |||
(ProducerInner { rb: self }, ConsumerInner { rb: self }) | |||
pub const fn split_const(&mut self) -> (Producer<'_, T>, Consumer<'_, T>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example here doesn't actually call this on QueueView
. In fact, I don't think this makes sense on QueueView
, since we first need a static Queue
anyways, so there is no point in going through a QueueView
to split it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to have it available for QueueView
if you have some const
functions that does some initialization, which you use to build the statics.
I updated the doc to use the View.
05ddff8
to
160870e
Compare
This needs a workaround for the
const
use case however