//arrow-fx-coroutines/arrow.fx.coroutines/parSequenceValidatedN

parSequenceValidatedN

common

@JvmName(name = “parSequenceValidatedNScoped”)

suspend fun <E, A> Iterable<suspend CoroutineScope.() -> Validated<E, A».parSequenceValidatedN(semigroup: Semigroup<E>, n: Int): Validated<E, List<A»

Traverses this Iterable and runs f in n parallel operations on CoroutineContext. If one or more of the tasks returns Validated.Invalid then all the Validated.Invalid results will be combined using semigroup.

Cancelling this operation cancels all running tasks.

common suspend fun <E, A> Iterable<suspend () -> Validated<E, A».parSequenceValidatedN(semigroup: Semigroup<E>, n: Int): Validated<E, List<A»

suspend fun <E, A> Iterable<suspend () -> Validated<E, A».parSequenceValidatedN(ctx: CoroutineContext = EmptyCoroutineContext, semigroup: Semigroup<E>, n: Int): Validated<E, List<A»

common

@JvmName(name = “parSequenceValidatedNScoped”)

suspend fun <E, A> Iterable<suspend CoroutineScope.() -> Validated<E, A».parSequenceValidatedN(ctx: CoroutineContext = EmptyCoroutineContext, semigroup: Semigroup<E>, n: Int): Validated<E, List<A»

Traverses this Iterable and runs f in n parallel operations on CoroutineContext. If one or more of the tasks returns Validated.Invalid then all the Validated.Invalid results will be combined using semigroup.

Coroutine context is inherited from a CoroutineScope, additional context elements can be specified with ctx argument. If the combined context does not have any dispatcher nor any other ContinuationInterceptor, then Dispatchers.Default is used. WARNING If the combined context has a single threaded ContinuationInterceptor, this function will not run in parallel.

Cancelling this operation cancels all running tasks.

Do you like Arrow?

Arrow Org
<