File tree Expand file tree Collapse file tree 2 files changed +28
-6
lines changed
src/FsToolkit.ErrorHandling
tests/FsToolkit.ErrorHandling.Tests Expand file tree Collapse file tree 2 files changed +28
-6
lines changed Original file line number Diff line number Diff line change @@ -126,13 +126,23 @@ module Async =
126126 ( input1 : Async < 'input1 >)
127127 ( input2 : Async < 'input2 >)
128128 : Async < 'output > =
129+
130+ #if FABLE_ COMPILER && FABLE_ COMPILER_ PYTHON
131+ Async.Parallel(
132+ [|
133+ map box input1
134+ map box input2
135+ |]
136+ )
137+ #else
129138 Async.Parallel(
130139 [|
131140 map box input1
132141 map box input2
133142 |],
134143 maxDegreeOfParallelism = 2
135144 )
145+ #endif
136146 |> map ( fun results ->
137147 let a =
138148 results[ 0 ]
@@ -159,6 +169,15 @@ module Async =
159169 ( input2 : Async < 'input2 >)
160170 ( input3 : Async < 'input3 >)
161171 : Async < 'output > =
172+ #if FABLE_ COMPILER && FABLE_ COMPILER_ PYTHON
173+ Async.Parallel(
174+ [|
175+ map box input1
176+ map box input2
177+ map box input3
178+ |]
179+ )
180+ #else
162181 Async.Parallel(
163182 [|
164183 map box input1
@@ -167,6 +186,7 @@ module Async =
167186 |],
168187 maxDegreeOfParallelism = 3
169188 )
189+ #endif
170190 |> map ( fun results ->
171191 let a =
172192 results[ 0 ]
Original file line number Diff line number Diff line change @@ -3,15 +3,17 @@ namespace FsToolkit.ErrorHandling
33[<RequireQualifiedAccess>]
44module Async =
55
6+ open System
7+
68 /// An Async that never completes but can be cancelled
79 let never < 'a > : Async < 'a > =
8- async {
9- let! ct = Async.CancellationToken
10-
11- let! _ = Async.AwaitWaitHandle( ct.WaitHandle)
10+ let rec loop () =
11+ async {
12+ do ! Async.Sleep( TimeSpan.FromHours 1 )
13+ return ! loop ()
14+ }
1215
13- return failwith " Unreachable"
14- }
16+ loop ()
1517
1618module TestHelpers =
1719 let makeDisposable ( callback ) =
You can’t perform that action at this time.
0 commit comments