-
-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
it would be nice to have a totally-non-allocating MPSC variant for embedded etc where instead of an Arc<ThingBuf<T>> the queue is stored in an &'static ThingBuf<T>. we can now do this even with waiting tasks now that #16 added an intrusive wait queue that doesn't allocate.
i think that the API for this will have to be something like:
static SOME_QUEUE: thingbuf::StaticMpsc<Event, 1024> = thingbuf::StaticMpsc::new();
fn main() {
let (tx, rx) = SOME_QUEUE.try_split()
.expect("queue split into sender/receiver pair more than once");
// ...
}because that's the only nice way to get all the important stuff in a static initializer and hand out &'static refs to it to a sender/receiver pair. i don't think we can just add a try_split to the normal StaticThingbuf type since the shared state also needs rx/tx wait cells...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request