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
Add CompilerMessage warning to groupBy and groupByAsync for parallel consumption requirement (#235)
Adds FS9999 warning to both groupBy and groupByAsync to alert callers that
the resulting sequence must be consumed with a parallel combinator (e.g.
AsyncSeq.mapAsyncParallel) to avoid deadlocks.
Closes#125
Co-authored-by: Repo Assist <[email protected]>
Co-authored-by: Copilot <[email protected]>
Copy file name to clipboardExpand all lines: src/FSharp.Control.AsyncSeq/AsyncSeq.fs
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1983,6 +1983,7 @@ module AsyncSeq =
1983
1983
toAsyncSeqImpl s.tail.Value
1984
1984
1985
1985
1986
+
[<CompilerMessage("The result of groupByAsync must be consumed with a parallel combinator such as AsyncSeq.mapAsyncParallel. Sequential consumption will deadlock because sub-sequence completion depends on other sub-sequences being consumed concurrently.",9999)>]
[<CompilerMessage("The result of groupBy must be consumed with a parallel combinator such as AsyncSeq.mapAsyncParallel. Sequential consumption will deadlock because sub-sequence completion depends on other sub-sequences being consumed concurrently.",9999)>]
Copy file name to clipboardExpand all lines: src/FSharp.Control.AsyncSeq/AsyncSeq.fsi
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -562,13 +562,15 @@ module AsyncSeq =
562
562
///
563
563
/// Note that the resulting async sequence has to be processed in parallel (e.g AsyncSeq.mapAsyncParallel) becaused
564
564
/// completion of sub-sequences depends on completion of other sub-sequences.
565
+
[<CompilerMessage("The result of groupByAsync must be consumed with a parallel combinator such as AsyncSeq.mapAsyncParallel. Sequential consumption will deadlock because sub-sequence completion depends on other sub-sequences being consumed concurrently.", 9999)>]
565
566
val groupByAsync<'T, 'Key when 'Key : equality>: projection:('T -> Async<'Key>)-> source:AsyncSeq<'T>-> AsyncSeq<'Key * AsyncSeq<'T>>
566
567
567
568
/// Applies a key-generating function to each element and returns an async sequence containing unique keys
568
569
/// and async sequences containing elements corresponding to the key.
569
570
///
570
571
/// Note that the resulting async sequence has to be processed in parallel (e.g AsyncSeq.mapAsyncParallel) becaused
571
572
/// completion of sub-sequences depends on completion of other sub-sequences.
573
+
[<CompilerMessage("The result of groupBy must be consumed with a parallel combinator such as AsyncSeq.mapAsyncParallel. Sequential consumption will deadlock because sub-sequence completion depends on other sub-sequences being consumed concurrently.", 9999)>]
572
574
val groupBy<'T, 'Key when 'Key : equality>: projection:('T -> 'Key)-> source:AsyncSeq<'T>-> AsyncSeq<'Key * AsyncSeq<'T>>
0 commit comments