Skip to content

TryMany

Name - Description Default Type
<input> [ Any ]
<output> [ Any ]
Wire The wire to spawn and try to run many times concurrently. None WireString&Wire
Policy The execution policy in terms of wires success. WaitUntil.AllSuccess WaitUntil
Threads The number of cpu threads to use. 1 Int
Coroutines The number of coroutines to run on each thread. 1 Int

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
(Const ["A" "B" "C"])
(TryMany
 ;:Wire
 (Wire
  "print"
  (Log)
  "Ok")
 ;:Policy
 WaitUntil.AllSuccess
 ;:Threads
 12
 ;:Coroutine
 1)
(Assert.Is ["Ok" "Ok" "Ok"] true)
[info] [print-2] B
[info] [print-3] C
[info] [print-1] A