Fishrock123 / bob

🚰 binary data "streams+" via data producers, data consumers, and pull flow.
MIT License
79 stars 8 forks source link

Buffer allocation hints #52

Open Fishrock123 opened 5 years ago

Fishrock123 commented 5 years ago

As much as I'd like to avoid it, it seems like some kind of hint system would be useful for telling who should allocate buffers and of what size.

Ideally, this would be done out of the regular pull flow (to avoid passing like 7 arguments every time). So, probably going to be connected to an other (yet to be made) issue about doing some kind of "construct" flow...

See https://github.com/Fishrock123/bob/issues/30#issuecomment-518582062

One piece of contention in the current design of the sink API is whom allocates the buffer. If I have data already in buffers that needs to be written to a socket or disk it doesn't make sense for the sink to allocate a write buffer and tell me to copy values into it.