Is your feature request related to a problem? Please describe.
Code migrating from System.Reactive relies on an exception ending the sequence. In R3, an exception thrown by an operator goes to OnErrorResume and the sequence continues; OnErrorResumeAsFailure turns it into OnCompleted(Result.Failure). FSharp.Control.R3 0.3.1 has no wrapper for it.
The XML doc of catch says "Exception does not stop further processing". In fact, catch handles only failures that complete the sequence; it never sees OnErrorResume:
#r "nuget: FSharp.Control.R3, 0.3.1"
open R3
open FSharp.Control.R3
let throwing () =
R3.Observable.ToObservable [ 1; 2; 3 ]
|> Observable.map (fun x -> if x = 2 then failwith "boom" else x)
throwing () |> Observable.catch (fun (_ : exn) -> Observable.Return 42)
// next 1; resume boom; next 3; completed — catch is not invoked
throwing () |> _.OnErrorResumeAsFailure() |> Observable.catch (fun (_ : exn) -> Observable.Return 42)
// next 1; next 42; completed
Describe the solution you'd like
val onErrorResumeAsFailure : source : Observable<'T> -> Observable<'T>
val materialize : source : Observable<'T> -> Observable<Notification<'T>>
val dematerialize : source : Observable<Notification<'T>> -> Observable<'T>
val subscribeWithCallbacks :
onNext : ('T -> unit) -> onErrorResume : (exn -> unit) -> onCompleted : (Result -> unit) -> source : Observable<'T> -> IDisposable
- The
catch doc states that it handles OnCompleted(Result.Failure) only and points to onErrorResumeAsFailure.
Additional context
FSharp.Data.GraphQL relies on stream failures being terminal. Its WebSocket transport subscribes with separate callbacks for items, errors and completion.
Is your feature request related to a problem? Please describe.
Code migrating from System.Reactive relies on an exception ending the sequence. In R3, an exception thrown by an operator goes to
OnErrorResumeand the sequence continues;OnErrorResumeAsFailureturns it intoOnCompleted(Result.Failure). FSharp.Control.R3 0.3.1 has no wrapper for it.The XML doc of
catchsays "Exception does not stop further processing". In fact,catchhandles only failures that complete the sequence; it never seesOnErrorResume:Describe the solution you'd like
catchdoc states that it handlesOnCompleted(Result.Failure)only and points toonErrorResumeAsFailure.Additional context
FSharp.Data.GraphQL relies on stream failures being terminal. Its WebSocket transport subscribes with separate callbacks for items, errors and completion.