Add ArcBBQueue framed constructors with explicit LenHeader#128
Add ArcBBQueue framed constructors with explicit LenHeader#128x46085 wants to merge 2 commits intojamesmunns:mainfrom
Conversation
This restores caller control over frame header width so downstream users can opt into usize-framed queues for payloads larger than 64 KiB. Made-with: Cursor
|
I'm open to this, one potential concern is that you could take producer/consumer halves with different header lengths, which probably wouldn't cause any soundness issues, but might cause problems. I'd have to check if non-Arc BBQueue has the same issues, but it might be worth including in the doc comments for these methods. Happy to merge and push a release otherwise. Also very open to smarter ways to handle this in general, though I think probably the Right way to handle this is to have separate |
Doesn't bbqueue/bbqueue/src/traits/bbqhdl.rs Lines 62 to 80 in f212a93 Though it might well be that it currently needs to be called explicitly because of how these two APIs overlap. |
|
Appreciate the quick turnaround and the thoughtful feedback. Just pushed doc comments on both new methods calling out the producer/consumer header-match requirement so future users don't foot-gun themselves. Keeping the change additive and narrowly scoped — happy to use the StreamBBQueue/FramedBBQueue split someday, happy to help test whenever you need. |
|
bump! ready to make any other requested changes! |
The existing framed_producer() and framed_consumer() methods on ArcBBQueue return handles hardcoded to u16 frame headers, which limits individual frames to 64 KiB. All the underlying types (FramedProducer, FramedConsumer, FramedGrantW, FramedGrantR) are already generic over the LenHeader trait, but the ArcBBQueue convenience constructors don't expose that generic. This adds framed_producer_with_header() and framed_consumer_with_header() companion methods that let the caller select the header type, such as usize for workloads that need frames larger than 64 KiB. The existing default-u16 methods are untouched.
In support of this upgrade; would resolve need for our fork in production:
elodin-sys/elodin#610