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: docs/articles/streams/builtinstages.md
+14-4
Original file line number
Diff line number
Diff line change
@@ -295,11 +295,11 @@ if more element are emitted the sink will cancel the stream
295
295
296
296
**cancels** If too many values are collected
297
297
298
-
### Foreach
298
+
### ForEach
299
299
300
300
Invoke a given procedure for each element received. Note that it is not safe to mutate shared state from the procedure.
301
301
302
-
The sink materializes into a ``Task`` which completes when the
302
+
The sink materializes into a ``Task<Done>`` which completes when the
303
303
stream completes, or fails if the stream fails.
304
304
305
305
Note that it is not safe to mutate state from the procedure.
@@ -308,9 +308,19 @@ Note that it is not safe to mutate state from the procedure.
308
308
309
309
**backpressures** when the previous procedure invocation has not yet completed
310
310
311
-
### ForeachParallel
311
+
### ForEachASync
312
312
313
-
Like ``Foreach`` but allows up to ``parallellism`` procedure calls to happen in parallel.
313
+
Invoke a given procedure asynchronously for each element received. Note that if shared state is mutated from the procedure that must be done in a thread-safe way.
314
+
315
+
The sink materializes into a ``Task<Done>`` which completes when the stream completes, or fails if the stream fails.
316
+
317
+
**cancels** when a ``Task`` fails
318
+
319
+
**backpressures** when the number of ``Task``s reaches the configured parallelism
320
+
321
+
### ForEachParallel
322
+
323
+
Like ``ForEach`` but allows up to ``parallellism`` procedure calls to happen in parallel.
0 commit comments