Open in0finite opened 1 month ago
Thanks for raising these issues - rather than adding more retry/throttling logic into this library, I've added an example of how to do this in the HttpClient: https://github.com/saul/demofile-net/pull/122/files. I will most likely move forward with this approach rather than the implementation you did here - I believe you can achieve the same behaviour this way still.
That PR still doesn't solve the issue of blocking : MoveNextAsync()
can still block even if EnqueuedFragmentsCount > 0
, because it waits multiple times in a loop, so it can process multiple fragments without advancing tick, and block.
This will prevent blocking in
MoveNextAsync()
, by callingWriter.Complete()
when exception happens, and will throw appropriate exception (the one from worker) when Channel becomes empty.So instead of blocking application for 10-15 seconds (like you suggested in other issue) when http broadcast has ended, you get the right exception immediately.
This PR also stops worker from entering infinite loop, when server starts returning 404 error for finished match.
Edit: removed blocking behavior from
MoveNextAsync()
, and added another methodWaitForAvailableDataAsync()
with same functionality