Open-NET-Libraries / Open.ChannelExtensions

A set of extensions for optimizing/simplifying System.Threading.Channels usage.
https://open-net-libraries.github.io/Open.ChannelExtensions/api/Open.ChannelExtensions.Extensions.html#methods
MIT License
416 stars 25 forks source link

WIP: New batching channel reader with timeout #10

Closed RagingKore closed 4 years ago

RagingKore commented 4 years ago

Hi, thanks for the great lib.

This PR essentially adds the capability to automatically flush and incomplete buffer, once a certain time span has passed since the last message was buffered.

The only pluggable points were TryPipeItems and WaitToReadAsyncCore.

I first used TryPipeItems as it seemed logical, but needed to away the delay. So ended up going for the WaitToReadAsyncCore that was already async.

Cheers,

electricessence commented 4 years ago

I apologize but I didn't have a dev branch for you to merge into so I could review. Please resubmit your pull request to the dev branch. I will eventually approve after reviewing and testing locally. Sorry for the late reply.