Skip to content
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

Allow taking just Producer or Consumer #40

Open
jamesmunns opened this issue Dec 4, 2019 · 1 comment
Open

Allow taking just Producer or Consumer #40

jamesmunns opened this issue Dec 4, 2019 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@jamesmunns
Copy link
Owner

Allow for the time-disjoint splitting of producer and consumer, allowing one context to take only the item it needs. Something like:

static BUF: BBBuffer<U8> = BBBuffer( ConstBBBuffer::new() );

fn one() {
    BUF.try_take_producer().unwrap().grant_exact(1).unwrap().commit(1);
}

fn two() {
   BUF.try_take_consumer().unwrap().read().unwrap().release(1);
}

fn main() {
    one();
    two();
}
@jamesmunns jamesmunns added this to the v0.4.x milestone Dec 4, 2019
@jamesmunns
Copy link
Owner Author

Optionally: Dropping the producer or consumer should allow for later re-taking of the producer or consumer.

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

Successfully merging a pull request may close this issue.

1 participant