Closed f0w9hef09sd0f9hs0d9fh closed 2 years ago
I'll take a look!
CancellationTokenSource
isn't used.
And you've never called .Complete()
so it will never finish.
You set the batch size to 2, so as soon as 1 and 2 are added, that batch is available and the following timeout effectively does nothing.
By adding the delay at the end (500), you throw everything off.
If you added logging, you could easily see:
And because the nature of awaiting and threading, you might have some ms deviation and it might get past batch 1.
I think you're over thinking it. It works as expected. What are you trying to accomplish?
Closing for now, but happy to help you figure anything out.
We had an extension on the UntilTimeout
method that needed to be updated since your library's method signature was changed. Thanks.
Yes. Some things due to suggestions have changed. The timeout feature took a long time to get right. Also note that you can get batches as queues now as they have some advantages when dealing with ownership and fail-over. I prefer queues because you can 'peek' and attempt to do something with an item, and then if the operation fails, you can pass the remaining items to a fail-over routine and still assume that any previous items removed from the queue were successful.
I do not understand why this test involving a Channel Reader keeps reaching
case 1:
in theswitch case
and still has two elements in the batch. Any ideas ? Every time I reachbatch.Should().HaveCount(1)
, thebatch
still has 2 items left. Same result whether I doRun Test
orDebug Test
so I am assuming it's not a timing issue ? I don't understand this (intern so quite new to all of these libraries).Thanks.