Closed tuscen closed 3 years ago
Looks good, I will look into implementing it.
Do you think if there's another way of controlling receiving thread in the queued update receiver other than StartReceiving
/StopReceiving
? I've tried to implement cancellation token support to YieldUpdatesAsync
and with the blocking receiver it was straightforward. But with the queued one the result is a complete mess from an API standpoint when you have two ways of stopping receiving thread.
Fixed in #7
Current implementation doesn't allow the following common pattern:
To allow this to work
YieldUpdatesAsync
needs to have cancellation token as a parameter with an attribute:This will allow uniform cancellation support in
IYieldingUpdateReceiver
implementations instead of ad-hoc params in different implementations.