You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-16Lines changed: 24 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ See [release notes.txt](release-notes.txt) for the version history of `TaskSeq`.
51
51
52
52
## Overview
53
53
54
-
The `IAsyncEnumerable` interface was added to .NET in `.NET Core 3.0` and is part of `.NET Standard 2.1`. The main use-case was for iterative asynchronous enumeration over some resource. For instance, an event stream or a REST API interface with pagination, asynchronous reading over a list of files and accumulating the results, where each action can be modeled as a [`MoveNextAsync`][4] call on the [`IAsyncEnumerator<'T>`][5] given by a call to [`GetAsyncEnumerator()`][6].
54
+
The `IAsyncEnumerable` interface was added to .NET in `.NET Core 3.0` and is part of `.NET Standard 2.1`. The main use-case was for iterative asynchronous enumeration over some resource. For instance, an event stream or a REST API interface with pagination, asynchronous reading over a list of files and accumulating the results, where each action can be modeled as a [`MoveNextAsync`][4] call on the [`IAsyncEnumerator<'T>`][3] given by a call to [`GetAsyncEnumerator()`][6].
55
55
56
56
Since the introduction of `task` in F# the call for a native implementation of _task sequences_ has grown, in particular because proper iteration over an `IAsyncEnumerable` has proven challenging, especially if one wants to avoid mutable variables. This library is an answer to that call and applies the same _resumable state machine_ approach with `taskSeq`.
|**Underlying type**|`System.Collections.Generic.IAsyncEnumerable<'T>`| Its own type, also called `IAsyncEnumerable<'T>`, but not compatible |
180
+
|**F# concept of**|`task`|`async`|
181
+
|**Underlying type**|[`Generic.IAsyncEnumerable<'T>`][3] <sup>[note #1](#tsnote1"Full name System.Collections.Generic.IAsyncEnumerable<'T>.")</sup>| Its own type, also called `IAsyncEnumerable<'T>`<sup>[note #1](#tsnote1"Full name FSharp.Control.IAsyncEnumerable<'T>.")</sup> |
181
182
|**Implementation**| State machine (statically compiled) | No state machine, continuation style |
|**Cancellation**| Implicit token governs iteration | Implicit token flows to all subtasks per `async` semantics |
194
-
|**Performance**| Very high, negligible allocations | Slower, more allocations, due to using `async`|
193
+
|**Iteration semantics**|[Two operations][6], 'Next' is a value task, 'Current' must be called separately| One operation, 'Next' is `Async`, returns `option` with 'Current' |
|**Cancellation**| See [#133][], until 0.3.0: use `GetAsyncEnumerator(cancelToken)`| Implicit token flows to all subtasks per `async` semantics |
197
+
|**Performance**| Very high, negligible allocations | Slower, more allocations, due to using `async` and cont style |
195
198
|**Parallelism**| Possible with ChildTask; support will follow | Supported explicitly |
196
199
200
+
<sup>¹⁾ <aid="tsnote1"></a>_Both `AsyncSeq` and `TaskSeq` use a type called `IAsyncEnumerable<'T>`, but only `TaskSeq` uses the type from the BCL Generic Collections. `AsyncSeq` supports .NET Framework 4.6.x and NetStandard 2.0 as well, which do not have this type in the BCL._</sup>
201
+
197
202
## Status & planning
198
203
199
204
This project has stable features currently, but before we go full "version one", we'd like to complete the surface area. This section covers the status of that, with a full list of implemented functions below. Here's the shortlist:
@@ -207,7 +212,7 @@ This project has stable features currently, but before we go full "version one",
207
212
208
213
### Implementation progress
209
214
210
-
As of 9 November 2022: [Nuget package available][21]. In this phase, we will frequently update the package. Current:
215
+
As of 9 November 2022: [Nuget package available][21]. In this phase, we will frequently update the package, see [release notes.txt](release-notes.txt). Current version:
0 commit comments