sozu-proxy / circular

stream abstraction designed for use with nom
MIT License
11 stars 7 forks source link

Add method to consume bytes without shifting buffer ? #2

Open chifflier opened 5 years ago

chifflier commented 5 years ago

Hi @Geal ,

The consume method shifts data if >= half the buffer. I'm using the circular crate as a fixed-position buffer (for multi-threading) and need to control when data is moved.

Would you be OK for adding a new method (consume_noshift or something ilke that) which just adds cnt without shifting data ? I can provide a patch :)

Geal commented 5 years ago

Yes, good idea! IIRC @keruspe too encountered an issue with a shift that happened at the wrong time

On Wed, Jun 5, 2019, 15:47 Pierre Chifflier notifications@github.com wrote:

Hi @Geal https://github.com/Geal ,

The consume method shifts data if >= half the buffer. I'm using the circular crate as a fixed-position buffer (for multi-threading) and need to control when data is moved.

Would you be OK for adding a new method (consume_noshift or something ilke that) which just adds cnt without shifting data ? I can provide a patch :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sozu-proxy/circular/issues/2?email_source=notifications&email_token=AAA5EAAC6PWTFZ6GSFRNXJ3PY67YJA5CNFSM4HTYGKJKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GXYY5CA, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA5EAB3TWYI4ETTDA5GN73PY67YJANCNFSM4HTYGKJA .

joeri commented 1 year ago

Unless I'm missing something this was added in 0.3 so this issue can be closed