Skip to content

Commit 2e92103

Browse files
authored
Merge branch 'main' into copilot/add-yieldfrom-overload
2 parents 613940e + b416593 commit 2e92103

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/FSharp.Control.AsyncSeq/AsyncSeq.fs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,6 +1986,7 @@ module AsyncSeq =
19861986
toAsyncSeqImpl s.tail.Value
19871987

19881988

1989+
[<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)>]
19891990
let groupByAsync (p:'a -> Async<'k>) (s:AsyncSeq<'a>) : AsyncSeq<'k * AsyncSeq<'a>> = asyncSeq {
19901991
let groups = Dictionary<'k, AsyncSeqSrc< 'a>>()
19911992
let close group =
@@ -2017,6 +2018,7 @@ module AsyncSeq =
20172018
raise ex }
20182019
yield! go () }
20192020

2021+
[<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)>]
20202022
let groupBy (p:'a -> 'k) (s:AsyncSeq<'a>) : AsyncSeq<'k * AsyncSeq<'a>> =
20212023
groupByAsync (p >> async.Return) s
20222024
#endif

src/FSharp.Control.AsyncSeq/AsyncSeq.fsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,13 +565,15 @@ module AsyncSeq =
565565
///
566566
/// Note that the resulting async sequence has to be processed in parallel (e.g AsyncSeq.mapAsyncParallel) becaused
567567
/// completion of sub-sequences depends on completion of other sub-sequences.
568+
[<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)>]
568569
val groupByAsync<'T, 'Key when 'Key : equality> : projection:('T -> Async<'Key>) -> source:AsyncSeq<'T> -> AsyncSeq<'Key * AsyncSeq<'T>>
569570

570571
/// Applies a key-generating function to each element and returns an async sequence containing unique keys
571572
/// and async sequences containing elements corresponding to the key.
572573
///
573574
/// Note that the resulting async sequence has to be processed in parallel (e.g AsyncSeq.mapAsyncParallel) becaused
574575
/// completion of sub-sequences depends on completion of other sub-sequences.
576+
[<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)>]
575577
val groupBy<'T, 'Key when 'Key : equality> : projection:('T -> 'Key) -> source:AsyncSeq<'T> -> AsyncSeq<'Key * AsyncSeq<'T>>
576578

577579
#if (NETSTANDARD || NET)

0 commit comments

Comments
 (0)