Skip to content

Commit 968df4a

Browse files
committed
docs
1 parent cf8e7d2 commit 968df4a

2 files changed

Lines changed: 27 additions & 25 deletions

File tree

src/FSharp.Control.AsyncSeq/AsyncSeq.fsi

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ module AsyncSeq =
208208
/// Asynchronously determine if the predicate returns true for all values in the sequence
209209
val forall : predicate:('T -> bool) -> source:AsyncSeq<'T> -> Async<bool>
210210

211-
/// Return an asynhronous sequence which, when iterated, includes an integer indicating the index of each element in the sequence.
211+
/// Return an asynchronous sequence which, when iterated, includes an integer indicating the index of each element in the sequence.
212212
val indexed : source:AsyncSeq<'T> -> AsyncSeq<int64 * 'T>
213213

214214
/// Asynchronously determine the number of elements in the sequence
@@ -371,12 +371,15 @@ module AsyncSeq =
371371
val bufferByCountAndTime : bufferSize:int -> timeoutMs:int -> source:AsyncSeq<'T> -> AsyncSeq<'T []>
372372

373373
/// Merges two async sequences into an async sequence non-deterministically.
374+
/// The resulting async sequence produces elements when any argument sequence produces an element.
374375
val mergeChoice: source1:AsyncSeq<'T1> -> source2:AsyncSeq<'T2> -> AsyncSeq<Choice<'T1,'T2>>
375376

376-
/// Merges two async sequences of the same typee into an async sequence non-deterministically.
377+
/// Merges two async sequences of the same type into an async sequence non-deterministically.
378+
/// The resulting async sequence produces elements when any argument sequence produces an element.
377379
val merge: source1:AsyncSeq<'T> -> source2:AsyncSeq<'T> -> AsyncSeq<'T>
378380

379381
/// Merges all specified async sequences into an async sequence non-deterministically.
382+
/// The resulting async sequence produces elements when any argument sequence produces an element.
380383
val mergeAll : sources:AsyncSeq<'T> list -> AsyncSeq<'T>
381384

382385
/// Returns an async sequence which contains no contiguous duplicate elements based on the specified comparison function.
@@ -394,30 +397,29 @@ module AsyncSeq =
394397
/// Builds a new asynchronous sequence whose elements are generated by
395398
/// applying the specified function to all elements of the input sequence.
396399
///
397-
/// The function is applied to elements in order but in parallel - without waiting
398-
/// for a prior mapping to complete.
400+
/// The function is applied to elements in order and results are emitted in order,
401+
/// but in parallel, without waiting for a prior mapping operation to complete.
402+
/// Parallelism is bound by the ThreadPool.
399403
val mapAsyncParallel : mapping:('T -> Async<'U>) -> s:AsyncSeq<'T> -> AsyncSeq<'U>
400404

401-
/// Builds a new asynchronous sequence whose elements are generated by
402-
/// applying the specified function to all elements of the input sequence.
403-
///
404-
/// The function is applied to elements in order but in parallel - without waiting
405-
/// for a prior mapping to complete. Up to the specified number of mappings will
406-
/// occur in parallel before non-blocking waiting.
407-
val mapAsyncParallelBounded : parallelism:int -> mapping:('T -> Async<'U>) -> s:AsyncSeq<'T> -> AsyncSeq<'U>
408-
409405
/// Applies a key-generating function to each element and returns an async sequence containing unique keys
410406
/// and async sequences containing elements corresponding to the key.
407+
///
408+
/// Note that the resulting async sequence has to be processed in parallel (e.g AsyncSeq.mapAsyncParallel) becaused
409+
/// completion of sub-sequences depends on completion of other sub-sequences.
411410
val groupByAsync<'T, 'Key when 'Key : equality> : projection:('T -> Async<'Key>) -> source:AsyncSeq<'T> -> AsyncSeq<'Key * AsyncSeq<'T>>
412411

413412
/// Applies a key-generating function to each element and returns an async sequence containing unique keys
414413
/// and async sequences containing elements corresponding to the key.
414+
///
415+
/// Note that the resulting async sequence has to be processed in parallel (e.g AsyncSeq.mapAsyncParallel) becaused
416+
/// completion of sub-sequences depends on completion of other sub-sequences.
415417
val groupBy<'T, 'Key when 'Key : equality> : projection:('T -> 'Key) -> source:AsyncSeq<'T> -> AsyncSeq<'Key * AsyncSeq<'T>>
416418

417-
/// An automatically-opened module tht contains the `asyncSeq` builder and an extension method
419+
/// An automatically-opened module that contains the `asyncSeq` builder and an extension method
418420
[<AutoOpen>]
419421
module AsyncSeqExtensions =
420-
/// Builds an asynchronou sequence using the computation builder syntax
422+
/// Builds an asynchronous sequence using the computation builder syntax
421423
val asyncSeq : AsyncSeq.AsyncSeqBuilder
422424

423425
/// Converts asynchronous sequence to a synchronous blocking sequence.

tests/FSharp.Control.AsyncSeq.Tests/AsyncSeqTests.fs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,17 +1147,17 @@ let ``AsyncSeq.mapParallelAsync should be parallel`` () =
11471147
Assert.AreEqual(expected, actual, timeout=200)
11481148

11491149
//[<Test>]
1150-
let ``AsyncSeq.mapParallelAsyncBounded should maintain order`` () =
1151-
let ls = List.init 500 id
1152-
let expected =
1153-
ls
1154-
|> AsyncSeq.ofSeq
1155-
|> AsyncSeq.mapAsync (async.Return)
1156-
let actual =
1157-
ls
1158-
|> AsyncSeq.ofSeq
1159-
|> AsyncSeq.mapAsyncParallelBounded 10 (async.Return)
1160-
Assert.AreEqual(expected, actual, timeout=200)
1150+
//let ``AsyncSeq.mapParallelAsyncBounded should maintain order`` () =
1151+
// let ls = List.init 500 id
1152+
// let expected =
1153+
// ls
1154+
// |> AsyncSeq.ofSeq
1155+
// |> AsyncSeq.mapAsync (async.Return)
1156+
// let actual =
1157+
// ls
1158+
// |> AsyncSeq.ofSeq
1159+
// |> AsyncSeq.mapAsyncParallelBounded 10 (async.Return)
1160+
// Assert.AreEqual(expected, actual, timeout=200)
11611161

11621162

11631163

0 commit comments

Comments
 (0)