Solution module
Postgres
Parent
#212 (item 2)
#215 (grilled: no Shared pump / helper)
What happened?
Postgres Reactive FromListen / FromListen<T> uses synchronous Observable.Create and fire-and-forget RunAsync. Typed FromListen<T> calls observer.OnError in the notification handler on deserialize failure but does not cancel the listen loop, so WaitAsync can still deliver OnNext / OnCompleted after OnError (Rx contract).
What I expected
A hot LISTEN stream uses System.Reactive Observable.Create(Func<IObserver<T>, CancellationToken, Task>) (same shape as R3). After OnError, the subscription stops: no further notifications, listen loop cancelled, UNLISTEN still runs.
Agreed fix (grilled)
- Switch Reactive hot listen to Rx async
Create. Dispose cancels the token Rx already passes in.
- On deserialize failure in
FromListen<T>, error the observer and stop the pump (cancel / leave WaitAsync).
- Do not change R3
OnErrorResume (different backend contract).
- One PR, Postgres module only.
Out of this ticket
Shared subscribe-pump extraction (declined on #215). Other Features' pumps.
Acceptance
Solution module
Postgres
Parent
#212 (item 2)
#215 (grilled: no Shared pump / helper)
What happened?
Postgres Reactive
FromListen/FromListen<T>uses synchronousObservable.Createand fire-and-forgetRunAsync. TypedFromListen<T>callsobserver.OnErrorin the notification handler on deserialize failure but does not cancel the listen loop, soWaitAsynccan still deliverOnNext/OnCompletedafterOnError(Rx contract).What I expected
A hot LISTEN stream uses System.Reactive
Observable.Create(Func<IObserver<T>, CancellationToken, Task>)(same shape as R3). AfterOnError, the subscription stops: no further notifications, listen loop cancelled, UNLISTEN still runs.Agreed fix (grilled)
Create. Dispose cancels the token Rx already passes in.FromListen<T>, error the observer and stop the pump (cancel / leaveWaitAsync).OnErrorResume(different backend contract).Out of this ticket
Shared subscribe-pump extraction (declined on #215). Other Features' pumps.
Acceptance
FromListen/FromListen<T>subscribe via Rx asyncCreate.OnErroronFromListen<T>, no furtherOnNext/OnCompleted.dotnet testPostgres.Tests / Postgres.Reactive.Tests / Postgres generator tests still pass.