Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sosthene-nitrokey
Copy link
Contributor

This needs a workaround for the const use case however

@sosthene-nitrokey sosthene-nitrokey force-pushed the spcs-demonomorphize branch 2 times, most recently from 970035f to e4c5b81 Compare April 29, 2025 13:01
@sosthene-nitrokey
Copy link
Contributor Author

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.

@sosthene-nitrokey sosthene-nitrokey force-pushed the spcs-demonomorphize branch 2 times, most recently from 9790bcf to 53bb179 Compare April 29, 2025 18:31
This needs a workaround for the `const` use case however
@@ -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>) {
Copy link
Member

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants