diff --git a/CHANGELOG.md b/CHANGELOG.md index a8b750c..b73f924 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Breaking:** `AwaitOperationConfiguration` cases are prefixed with `Await` (`AwaitSequential`, `AwaitParallel 4`, ...) so they no longer collide with `System.Threading.Tasks.Parallel` - **Breaking:** the `Async` functions raise the original exception instead of an `AggregateException`, and a cancelled operation cancels the computation instead of failing it - **Breaking:** the `Async` `toLookup` overloads no longer take a `cancellationToken`; they observe the token of the computation +- **Breaking:** `ofTask` defaults `configureAwait` to `true`, like R3 and `ofAsync` - **Breaking:** the `OptionExtensions`/`ValueOptionExtensions` types are replaced by `Observable.choose`, which takes a `voption` chooser, and `ObservableOption.choose` for `option`; the `Observable.Extensions` type is replaced by `Observable.ofSeq` - **Breaking:** after `open FSharp.Control.R3`, `Observable.choose` is the R3 function, like `Observable.map` and `Observable.filter` already were; use `Microsoft.FSharp.Control.Observable.choose` for `IObservable` and F# events - **Breaking:** after `open FSharp.Control.R3`, the bare type name `Observable` refers to `FSharp.Control.R3.ObservableFactories.Observable`; write `open type R3.Observable` and extend `R3.Observable` by its full name diff --git a/src/FSharp.Control.R3/TaskObservable.fs b/src/FSharp.Control.R3/TaskObservable.fs index 122d55f..ca77f4f 100644 --- a/src/FSharp.Control.R3/TaskObservable.fs +++ b/src/FSharp.Control.R3/TaskObservable.fs @@ -114,15 +114,29 @@ module Extensions = type Observable private () = /// - /// Creates observable sequence from a single element returned by cancellable + /// Creates an observable sequence that invokes the factory on every subscription, emits + /// when its completes, and then completes. + /// + /// Disposing the subscription cancels the token passed to the factory. A failure of the task completes the sequence + /// with that failure. (true by default) defines whether the continuation + /// resumes on the captured synchronization context. + /// /// - static member inline ofTask (asyncFactory : CancellationToken -> ValueTask, [] configureAwait) = + static member inline ofTask (asyncFactory : CancellationToken -> ValueTask, [] configureAwait : bool) = Observable.FromAsync (asyncFactory, configureAwait) /// - /// Creates observable sequence from a single element returned by cancellable + /// Creates an observable sequence that invokes the factory on every subscription, emits the result of its + /// , and then completes. + /// + /// Disposing the subscription cancels the token passed to the factory. A failure of the task completes the sequence + /// with that failure. (true by default) defines whether the continuation + /// resumes on the captured synchronization context. + /// /// - static member inline ofTask (asyncFactory : CancellationToken -> ValueTask<'T>, [] configureAwait) = + static member inline ofTask + (asyncFactory : CancellationToken -> ValueTask<'T>, [] configureAwait : bool) + = Observable.FromAsync (asyncFactory, configureAwait) static member inline toArray (source, [] cancellationToken) = ObservableExtensions.ToArrayAsync (source, cancellationToken)