Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
See [the home page](http://fsprojects.github.io/FSharp.Control.AsyncSeq/) for details. The home page can be [edited, forked or cloned](https://github.com/fsprojects/FSharp.Control.AsyncSeq/tree/master/docs/content)
Please contribute to this project. Don't ask for permission, just fork the repository and send pull requests.

## Version 4.0 — BCL IAsyncEnumerable Compatibility

As of **v4.0**, `AsyncSeq<'T>` is a type alias for `System.Collections.Generic.IAsyncEnumerable<'T>` (the BCL type). This means:

- `AsyncSeq<'T>` values are directly usable anywhere `IAsyncEnumerable<'T>` is expected (e.g. `await foreach` in C#, `IAsyncEnumerable<T>` APIs).
- `IAsyncEnumerable<'T>` values (from EF Core, ASP.NET Core streaming endpoints, etc.) can be used directly wherever `AsyncSeq<'T>` is expected — no conversion needed.
- The `AsyncSeq.ofAsyncEnum` and `AsyncSeq.toAsyncEnum` helpers are now **no-ops** and have been marked `[<Obsolete>]`. Remove any calls to them.

### Migrating from v3.x

If you called `.GetEnumerator()` / `.MoveNext()` directly on an `AsyncSeq<'T>`, update to `.GetAsyncEnumerator(ct)` / `.MoveNextAsync()` (the `IAsyncEnumerator<'T>` BCL contract). All other `AsyncSeq` module combinators are unchanged.

# Maintainer(s)

- [@dsyme](https://github.com/dsyme)
Expand Down
4 changes: 4 additions & 0 deletions docs/AsyncSeq.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ latter based on a "synchronous push". Analogs for most operations defined for `S
`AsyncSeq`. The power of `AsyncSeq` lies in that many of these operations also have analogs based on `Async`
allowing composition of complex asynchronous workflows.

> **v4.0 and later:** `AsyncSeq<'T>` is a type alias for `System.Collections.Generic.IAsyncEnumerable<'T>`.
> Any `IAsyncEnumerable<'T>` value (e.g. from EF Core, ASP.NET Core channels, or `taskSeq { }`) can be used
> directly as an `AsyncSeq<'T>` without conversion, and vice-versa.

The `AsyncSeq` type is located in the `FSharp.Control.AsyncSeq.dll` assembly which can be loaded in F# Interactive as follows:
*)

Expand Down
7 changes: 6 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ FSharp.Control.AsyncSeq

FSharp.Control.AsyncSeq is a collection of asynchronous programming utilities for F#.

An AsyncSeq is a sequence in which individual elements are retrieved using an `Async` computation.
An `AsyncSeq<'T>` is a sequence in which individual elements are retrieved using an `Async` computation.
The power of `AsyncSeq` lies in that many of these operations also have analogs based on `Async`
allowing composition of complex asynchronous workflows, including compositional cancellation.

> **v4.0:** `AsyncSeq<'T>` is now a type alias for `System.Collections.Generic.IAsyncEnumerable<'T>`.
> Values flow freely between `AsyncSeq<'T>` and `IAsyncEnumerable<'T>` without any conversion.
> `AsyncSeq.ofAsyncEnum` / `AsyncSeq.toAsyncEnum` are now no-ops and marked obsolete — remove them.
> See the [README](https://github.com/fsprojects/FSharp.Control.AsyncSeq#version-40--bcl-iasyncenumerable-compatibility) for migration notes.

An `AsyncSeq<'a>` can be generated using computation expression syntax much like `seq<'a>`:

let oneThenTwo = asyncSeq {
Expand Down
Loading