Closed KenBonny closed 1 year ago
I may not understand your use-case exactly, but 'unbatch' = .Join
. Which allows for any IEnumerable<T>
to be the type of the contents within a channel. You can simply call .Join()
on a ChannelReader<T[]>
(for example) to convert to a ChannelReader<T>
.
Another thing to consider is that if this doesn't solve your problem, then .Pipe
and .PipeAsync
methods might be what you need.
Lemme know if that helps.
I also think that if .Join()
, .Pipe()
, or .PipeAsync()
can't do it, then you might simply need another channel to act as the batch receiver with an intermediate consumer that creates the batches.
You are completely correct. I misunderstood the Join
transform. I thought it was to join everything in one list, but that is what the ReadAll
transform is for. So Join
is the inverse of Batch
. That is what I indeed want to do. 🤦
Thank you for your time. ❤️
Hello and first of all, awesome library. Making my life a lot easier already. But I seem to missing something. I batched results to perform database lookups efficiently (I don't want 500 db looksup, I want 5 queries that fetch 100 rows each). Now I want to split them back out. But I can't seem to find how to do this.
Am I missing or overlooking something? Is there a pattern to do it (return
IAsyncEnumerable<T>
)? Or is there no extension to easily do this?