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
+15-7Lines changed: 15 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ Latest version [can be installed from Nuget][nuget].
48
48
49
49
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].
50
50
51
-
Since the introduction of `task` in F# the call for a native implementation of _task sequences_ has grown, in particular because proper iterating over an `IAsyncEnumerable` has proven challenging, especially if one wants to avoid mutable variables. This library is an answer to that call and implements the same _resumable state machine_ approach with `taskSeq`.
51
+
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`.
52
52
53
53
### Module functions
54
54
@@ -58,9 +58,12 @@ As with `seq` and `Seq`, this library comes with a bunch of well-known collectio
58
58
59
59
### `taskSeq` computation expressions
60
60
61
-
The `taskSeq` computation expression can be used just like using `seq`. On top of that, it adds support for working with tasks through `let!` and
62
-
looping over a normal or asynchronous sequence (one that implements `IAsyncEnumerable<'T>'`). You can use `yield!` and `yield` and there's support
63
-
for `use` and `use!`, `try-with` and `try-finally` and `while` loops within the task sequence expression:
61
+
The `taskSeq` computation expression can be used just like using `seq`.
62
+
Additionally, it adds support for working with `Task`s through `let!` and
63
+
looping over both normal and asynchronous sequences (ones that implement
64
+
`IAsyncEnumerable<'T>'`). You can use `yield!` and `yield` and there's support
65
+
for `use` and `use!`, `try-with` and `try-finally` and `while` loops within
66
+
the task sequence expression:
64
67
65
68
### Installation
66
69
@@ -183,7 +186,7 @@ The _resumable state machine_ backing the `taskSeq` CE is now finished and _rest
183
186
184
187
### Progress and implemented `TaskSeq` module functions
185
188
186
-
We are working hard on getting a full set of module functions on `TaskSeq` that can be used with `IAsyncEnumerable` sequences. Our guide is the set of F# `Seq` functions in F# Core and, where applicable, the functions provided from`AsyncSeq`. Each implemented function is documented through XML doc comments to provide the necessary context-sensitive help.
189
+
We are working hard on getting a full set of module functions on `TaskSeq` that can be used with `IAsyncEnumerable` sequences. Our guide is the set of F# `Seq` functions in F# Core and, where applicable, the functions provided by`AsyncSeq`. Each implemented function is documented through XML doc comments to provide the necessary context-sensitive help.
187
190
188
191
The following is the progress report:
189
192
@@ -327,12 +330,17 @@ The following is the progress report:
327
330
328
331
## More information
329
332
330
-
### Further reading `IAsyncEnumerable`
333
+
### The AsyncSeq library
334
+
335
+
If you're looking to use `IAsyncEnumerable` with `async` and not `task`, the existing [`AsyncSeq`][11] library already provides excellent coverage of that use case. While `TaskSeq` is intended to interoperate with `async` as `task` does, it's not intended to provide an `AsyncSeq` type (at least not yet).
336
+
337
+
In short, if your application is using `Async` (and the parallelism features stemming from that), consider using the `AsyncSeq` library instead.
338
+
339
+
### Further reading on `IAsyncEnumerable`
331
340
332
341
- A good C#-based introduction [can be found in this blog][8].
333
342
-[An MSDN article][9] written shortly after it was introduced.
334
343
- Converting a `seq` to an `IAsyncEnumerable`[demo gist][10] as an example, though `TaskSeq` contains many more utility functions and uses a slightly different approach.
335
-
- If you're looking for using `IAsyncEnumerable` with `async` and not `task`, the excellent [`AsyncSeq`][11] library should be used. While `TaskSeq` is intended to consume `async` just like `task` does, it won't create an `AsyncSeq` type (at least not yet). If you want classic Async and parallelism, you should get this library instead.
0 commit comments