Sitelet https://github.com/fsprojects/FSharp.Control.R3/issues/16
Skip to content

Add interop with System.IObservable<'T> and IAsyncEnumerable<'T> #16

Description

@xperiandri

Is your feature request related to a problem? Please describe.
Libraries that move to R3 still expose or consume System.IObservable<T> and IAsyncEnumerable<T> at their public boundaries. R3 has the conversions — ToObservable(this IObservable<T>), AsSystemObservable, ToObservable(this IAsyncEnumerable<T>), Observable.CreateFrom(Func<CancellationToken, IAsyncEnumerable<T>>) and ToAsyncEnumerable — but FSharp.Control.R3 0.3.1 wraps none of them.

Describe the solution you'd like

// FSharp.Control.R3.Observable
val ofSystemObservable : source : IObservable<'T> -> Observable<'T>
val toSystemObservable : source : Observable<'T> -> IObservable<'T>
val ofAsyncEnumerable : source : IAsyncEnumerable<'T> -> Observable<'T>

// FSharp.Control.R3.Task.Observable
val ofAsyncEnumerableFactory : factory : (CancellationToken -> IAsyncEnumerable<'T>) -> Observable<'T>
val toAsyncEnumerable : cancellationToken : CancellationToken -> source : Observable<'T> -> IAsyncEnumerable<'T>

Names are a suggestion. ofAsyncEnumerable composes with taskSeq { } from FSharp.Control.TaskSeq.

Additional context
FSharp.Data.GraphQL exposes IObservable<_> in its subscription provider interfaces, which live in a netstandard2.0 assembly, and resolves @stream fields from IAsyncEnumerable<_>.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions