par Tupled
Runs fa, fb in parallel on ctx and combines their results as a tuple.
Coroutine context is inherited from caller, additional context elements can be specified with context argument. If the context does not have any dispatcher nor any other ContinuationInterceptor, then Dispatchers.Default is used.
import arrow.fx.coroutines.*
import kotlinx.coroutines.Dispatchers
suspend fun main(): Unit {
//sampleStart
val result = parTupled(
Dispatchers.IO,
{ "First one is on ${Thread.currentThread().name}" },
{ "Second one is on ${Thread.currentThread().name}" }
)
//sampleEnd
println(result)
}Parameters
value to parallel tuple
value to parallel tuple
Runs fa, fb, fc in parallel on ctx and combines their results as a tuple.
Coroutine context is inherited from caller, additional context elements can be specified with context argument. If the context does not have any dispatcher nor any other ContinuationInterceptor, then Dispatchers.Default is used.
import arrow.fx.coroutines.*
import kotlinx.coroutines.Dispatchers
suspend fun main(): Unit {
//sampleStart
val result: Triple<String, String, String> = parTupled(
Dispatchers.IO,
{ "First one is on ${Thread.currentThread().name}" },
{ "Second one is on ${Thread.currentThread().name}" },
{ "Third one is on ${Thread.currentThread().name}" }
)
//sampleEnd
println(result)
}Parameters
value to parallel tuple
value to parallel tuple
value to parallel tuple
Runs fa, fb, fc, fd in parallel on ctx and combines their results as a tuple.
Coroutine context is inherited from caller, additional context elements can be specified with context argument. If the context does not have any dispatcher nor any other ContinuationInterceptor, then Dispatchers.Default is used.
import arrow.fx.coroutines.*
import kotlinx.coroutines.Dispatchers
suspend fun main(): Unit {
//sampleStart
val result = parTupled(
Dispatchers.IO,
{ "First one is on ${Thread.currentThread().name}" },
{ "Second one is on ${Thread.currentThread().name}" },
{ "Third one is on ${Thread.currentThread().name}" },
{ "Fourth one is on ${Thread.currentThread().name}" }
)
//sampleEnd
println(result)
}Parameters
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
Runs fa, fb, fc, fd, fe in parallel on ctx and combines their results as a tuple.
Coroutine context is inherited from caller, additional context elements can be specified with context argument. If the context does not have any dispatcher nor any other ContinuationInterceptor, then Dispatchers.Default is used.
import arrow.fx.coroutines.*
import kotlinx.coroutines.Dispatchers
suspend fun main(): Unit {
//sampleStart
val result = parTupled(
Dispatchers.IO,
{ "First one is on ${Thread.currentThread().name}" },
{ "Second one is on ${Thread.currentThread().name}" },
{ "Third one is on ${Thread.currentThread().name}" },
{ "Fourth one is on ${Thread.currentThread().name}" },
{ "Fifth one is on ${Thread.currentThread().name}" }
)
//sampleEnd
println(result)
}Parameters
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
Runs fa, fb, fc, fd, fe, ff in parallel on ctx and combines their results as a tuple.
Coroutine context is inherited from caller, additional context elements can be specified with context argument. If the context does not have any dispatcher nor any other ContinuationInterceptor, then Dispatchers.Default is used.
import arrow.fx.coroutines.*
import kotlinx.coroutines.Dispatchers
suspend fun main(): Unit {
//sampleStart
val result = parTupled(
Dispatchers.IO,
{ "First one is on ${Thread.currentThread().name}" },
{ "Second one is on ${Thread.currentThread().name}" },
{ "Third one is on ${Thread.currentThread().name}" },
{ "Fourth one is on ${Thread.currentThread().name}" },
{ "Fifth one is on ${Thread.currentThread().name}" },
{ "Sixth one is on ${Thread.currentThread().name}" }
)
//sampleEnd
println(result)
}Parameters
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
Runs fa, fb, fc, fd, fe, ff, fg in parallel on ctx and combines their results as a tuple.
Coroutine context is inherited from caller, additional context elements can be specified with context argument. If the context does not have any dispatcher nor any other ContinuationInterceptor, then Dispatchers.Default is used.
import arrow.fx.coroutines.*
import kotlinx.coroutines.Dispatchers
suspend fun main(): Unit {
//sampleStart
val result = parTupled(
Dispatchers.IO,
{ "First one is on ${Thread.currentThread().name}" },
{ "Second one is on ${Thread.currentThread().name}" },
{ "Third one is on ${Thread.currentThread().name}" },
{ "Fourth one is on ${Thread.currentThread().name}" },
{ "Fifth one is on ${Thread.currentThread().name}" },
{ "Sixth one is on ${Thread.currentThread().name}" },
{ "Seventh one is on ${Thread.currentThread().name}" },
)
//sampleEnd
println(result)
}Parameters
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
Runs fa, fb, fc, fd, fe, ff, fg, fh in parallel on ctx and combines their results as a tuple.
Coroutine context is inherited from caller, additional context elements can be specified with context argument. If the context does not have any dispatcher nor any other ContinuationInterceptor, then Dispatchers.Default is used.
import arrow.fx.coroutines.*
import kotlinx.coroutines.Dispatchers
suspend fun main(): Unit {
//sampleStart
val result = parTupled(
Dispatchers.IO,
{ "First one is on ${Thread.currentThread().name}" },
{ "Second one is on ${Thread.currentThread().name}" },
{ "Third one is on ${Thread.currentThread().name}" },
{ "Fourth one is on ${Thread.currentThread().name}" },
{ "Fifth one is on ${Thread.currentThread().name}" },
{ "Sixth one is on ${Thread.currentThread().name}" },
{ "Seventh one is on ${Thread.currentThread().name}" },
{ "Eighth one is on ${Thread.currentThread().name}" }
)
//sampleEnd
println(result)
}Parameters
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
Runs fa, fb, fc, fd, fe, ff, fg, fh, fi in parallel on ctx and combines their results as a tuple.
Coroutine context is inherited from caller, additional context elements can be specified with context argument. If the context does not have any dispatcher nor any other ContinuationInterceptor, then Dispatchers.Default is used.
import arrow.fx.coroutines.*
import kotlinx.coroutines.Dispatchers
suspend fun main(): Unit {
//sampleStart
val result = parTupled(
Dispatchers.IO,
{ "First one is on ${Thread.currentThread().name}" },
{ "Second one is on ${Thread.currentThread().name}" },
{ "Third one is on ${Thread.currentThread().name}" },
{ "Fourth one is on ${Thread.currentThread().name}" },
{ "Fifth one is on ${Thread.currentThread().name}" },
{ "Sixth one is on ${Thread.currentThread().name}" },
{ "Seventh one is on ${Thread.currentThread().name}" },
{ "Eighth one is on ${Thread.currentThread().name}" },
{ "Ninth one is on ${Thread.currentThread().name}" }
)
//sampleEnd
println(result)
}Parameters
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple
value to parallel tuple