Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Racing DSL #3411

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,46 @@ public final class arrow/fx/coroutines/Race3Kt {
public static synthetic fun raceN$default (Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}

public final class arrow/fx/coroutines/RacingKt {
public static final fun racing (Larrow/core/raise/Raise;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun racing (Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun racing$default (Larrow/core/raise/Raise;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static synthetic fun racing$default (Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}

public abstract interface class arrow/fx/coroutines/RacingScope {
public abstract fun race (Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun raceOrFail (Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class arrow/fx/coroutines/RacingScope$DefaultImpls {
public static synthetic fun race$default (Larrow/fx/coroutines/RacingScope;Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static synthetic fun raceOrFail$default (Larrow/fx/coroutines/RacingScope;Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}

public abstract interface class arrow/fx/coroutines/RaiseRacingScope : arrow/core/raise/Raise {
public abstract fun race (Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun raceOrFail (Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun raceOrRaise (Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun raceOrThrow (Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class arrow/fx/coroutines/RaiseRacingScope$DefaultImpls {
public static fun bind (Larrow/fx/coroutines/RaiseRacingScope;Larrow/core/Either;)Ljava/lang/Object;
public static fun bind (Larrow/fx/coroutines/RaiseRacingScope;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static fun bind (Larrow/fx/coroutines/RaiseRacingScope;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static fun bindAll (Larrow/fx/coroutines/RaiseRacingScope;Ljava/lang/Iterable;)Ljava/util/List;
public static fun bindAll (Larrow/fx/coroutines/RaiseRacingScope;Ljava/util/Map;)Ljava/util/Map;
public static fun bindAll-1TN0_VU (Larrow/fx/coroutines/RaiseRacingScope;Ljava/util/Set;)Ljava/util/Set;
public static fun bindAll-vcjLgH4 (Larrow/fx/coroutines/RaiseRacingScope;Ljava/util/List;)Ljava/util/List;
public static fun invoke (Larrow/fx/coroutines/RaiseRacingScope;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static fun invoke (Larrow/fx/coroutines/RaiseRacingScope;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun race$default (Larrow/fx/coroutines/RaiseRacingScope;Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static synthetic fun raceOrFail$default (Larrow/fx/coroutines/RaiseRacingScope;Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static synthetic fun raceOrRaise$default (Larrow/fx/coroutines/RaiseRacingScope;Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static synthetic fun raceOrThrow$default (Larrow/fx/coroutines/RaiseRacingScope;Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}

public abstract interface annotation class arrow/fx/coroutines/ResourceDSL : java/lang/annotation/Annotation {
}

Expand Down
14 changes: 14 additions & 0 deletions arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ open annotation class arrow.fx.coroutines/ScopeDSL : kotlin/Annotation { // arro
constructor <init>() // arrow.fx.coroutines/ScopeDSL.<init>|<init>(){}[0]
}

abstract interface <#A: kotlin/Any?, #B: kotlin/Any?> arrow.fx.coroutines/RaiseRacingScope : arrow.core.raise/Raise<#A> { // arrow.fx.coroutines/RaiseRacingScope|null[0]
abstract suspend fun race(kotlin.coroutines/CoroutineContext = ..., kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<#A>, #B>) // arrow.fx.coroutines/RaiseRacingScope.race|race(kotlin.coroutines.CoroutineContext;kotlin.coroutines.SuspendFunction1<arrow.core.raise.Raise<1:0>,1:1>){}[0]
abstract suspend fun raceOrFail(kotlin.coroutines/CoroutineContext = ..., kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<#A>, #B>) // arrow.fx.coroutines/RaiseRacingScope.raceOrFail|raceOrFail(kotlin.coroutines.CoroutineContext;kotlin.coroutines.SuspendFunction1<arrow.core.raise.Raise<1:0>,1:1>){}[0]
abstract suspend fun raceOrRaise(kotlin.coroutines/CoroutineContext = ..., kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<#A>, #B>) // arrow.fx.coroutines/RaiseRacingScope.raceOrRaise|raceOrRaise(kotlin.coroutines.CoroutineContext;kotlin.coroutines.SuspendFunction1<arrow.core.raise.Raise<1:0>,1:1>){}[0]
abstract suspend fun raceOrThrow(kotlin.coroutines/CoroutineContext = ..., kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<#A>, #B>) // arrow.fx.coroutines/RaiseRacingScope.raceOrThrow|raceOrThrow(kotlin.coroutines.CoroutineContext;kotlin.coroutines.SuspendFunction1<arrow.core.raise.Raise<1:0>,1:1>){}[0]
}

abstract interface <#A: kotlin/Any?> arrow.fx.coroutines/RacingScope { // arrow.fx.coroutines/RacingScope|null[0]
abstract suspend fun race(kotlin.coroutines/CoroutineContext = ..., kotlin.coroutines/SuspendFunction1<kotlinx.coroutines/CoroutineScope, #A>) // arrow.fx.coroutines/RacingScope.race|race(kotlin.coroutines.CoroutineContext;kotlin.coroutines.SuspendFunction1<kotlinx.coroutines.CoroutineScope,1:0>){}[0]
abstract suspend fun raceOrFail(kotlin.coroutines/CoroutineContext = ..., kotlin.coroutines/SuspendFunction1<kotlinx.coroutines/CoroutineScope, #A>) // arrow.fx.coroutines/RacingScope.raceOrFail|raceOrFail(kotlin.coroutines.CoroutineContext;kotlin.coroutines.SuspendFunction1<kotlinx.coroutines.CoroutineScope,1:0>){}[0]
}

abstract interface arrow.fx.coroutines/ResourceScope : arrow/AutoCloseScope { // arrow.fx.coroutines/ResourceScope|null[0]
abstract suspend fun <#A1: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.fx.coroutines/ResourceScope, #A1>).bind(): #A1 // arrow.fx.coroutines/ResourceScope.bind|bind@kotlin.coroutines.SuspendFunction1<arrow.fx.coroutines.ResourceScope,0:0>(){0§<kotlin.Any?>}[0]
abstract suspend fun <#A1: kotlin/Any?> install(kotlin.coroutines/SuspendFunction1<arrow.fx.coroutines/AcquireStep, #A1>, kotlin.coroutines/SuspendFunction2<#A1, arrow.fx.coroutines/ExitCase, kotlin/Unit>): #A1 // arrow.fx.coroutines/ResourceScope.install|install(kotlin.coroutines.SuspendFunction1<arrow.fx.coroutines.AcquireStep,0:0>;kotlin.coroutines.SuspendFunction2<0:0,arrow.fx.coroutines.ExitCase,kotlin.Unit>){0§<kotlin.Any?>}[0]
Expand Down Expand Up @@ -162,6 +174,7 @@ final suspend fun <#A: kotlin/Any?, #B: kotlin/Any?, #C: kotlin/Any?> (kotlin.co
final suspend fun <#A: kotlin/Any?, #B: kotlin/Any?, #C: kotlin/Any?> (kotlin.collections/Iterable<#B>).arrow.fx.coroutines/parMapOrAccumulate(kotlin.coroutines/CoroutineContext = ..., kotlin/Function2<#A, #A, #A>, kotlin.coroutines/SuspendFunction2<arrow.fx.coroutines/ScopedRaiseAccumulate<#A>, #B, #C>): arrow.core/Either<#A, kotlin.collections/List<#C>> // arrow.fx.coroutines/parMapOrAccumulate|parMapOrAccumulate@kotlin.collections.Iterable<0:1>(kotlin.coroutines.CoroutineContext;kotlin.Function2<0:0,0:0,0:0>;kotlin.coroutines.SuspendFunction2<arrow.fx.coroutines.ScopedRaiseAccumulate<0:0>,0:1,0:2>){0§<kotlin.Any?>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?, #B: kotlin/Any?, #C: kotlin/Any?> (kotlin.collections/Iterable<#B>).arrow.fx.coroutines/parMapOrAccumulate(kotlin.coroutines/CoroutineContext = ..., kotlin/Int, kotlin.coroutines/SuspendFunction2<arrow.fx.coroutines/ScopedRaiseAccumulate<#A>, #B, #C>): arrow.core/Either<arrow.core/NonEmptyList<#A>, kotlin.collections/List<#C>> // arrow.fx.coroutines/parMapOrAccumulate|parMapOrAccumulate@kotlin.collections.Iterable<0:1>(kotlin.coroutines.CoroutineContext;kotlin.Int;kotlin.coroutines.SuspendFunction2<arrow.fx.coroutines.ScopedRaiseAccumulate<0:0>,0:1,0:2>){0§<kotlin.Any?>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?, #B: kotlin/Any?, #C: kotlin/Any?> (kotlin.collections/Iterable<#B>).arrow.fx.coroutines/parMapOrAccumulate(kotlin.coroutines/CoroutineContext = ..., kotlin/Int, kotlin/Function2<#A, #A, #A>, kotlin.coroutines/SuspendFunction2<arrow.fx.coroutines/ScopedRaiseAccumulate<#A>, #B, #C>): arrow.core/Either<#A, kotlin.collections/List<#C>> // arrow.fx.coroutines/parMapOrAccumulate|parMapOrAccumulate@kotlin.collections.Iterable<0:1>(kotlin.coroutines.CoroutineContext;kotlin.Int;kotlin.Function2<0:0,0:0,0:0>;kotlin.coroutines.SuspendFunction2<arrow.fx.coroutines.ScopedRaiseAccumulate<0:0>,0:1,0:2>){0§<kotlin.Any?>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?, #B: kotlin/Any?> (arrow.core.raise/Raise<#A>).arrow.fx.coroutines/racing(kotlin.coroutines/SuspendFunction1<#A, kotlin/Unit>, kotlin.coroutines/SuspendFunction2<kotlin.coroutines/CoroutineContext, kotlin/Throwable, kotlin/Unit>? = ..., kotlin/Function1<arrow.fx.coroutines/RacingScope<#B>, kotlin/Unit>): #B // arrow.fx.coroutines/racing|racing@arrow.core.raise.Raise<0:0>(kotlin.coroutines.SuspendFunction1<0:0,kotlin.Unit>;kotlin.coroutines.SuspendFunction2<kotlin.coroutines.CoroutineContext,kotlin.Throwable,kotlin.Unit>?;kotlin.Function1<arrow.fx.coroutines.RacingScope<0:1>,kotlin.Unit>){0§<kotlin.Any?>;1§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?, #B: kotlin/Any?> (kotlin.collections/Iterable<#A>).arrow.fx.coroutines/parMap(kotlin.coroutines/CoroutineContext = ..., kotlin.coroutines/SuspendFunction2<kotlinx.coroutines/CoroutineScope, #A, #B>): kotlin.collections/List<#B> // arrow.fx.coroutines/parMap|parMap@kotlin.collections.Iterable<0:0>(kotlin.coroutines.CoroutineContext;kotlin.coroutines.SuspendFunction2<kotlinx.coroutines.CoroutineScope,0:0,0:1>){0§<kotlin.Any?>;1§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?, #B: kotlin/Any?> (kotlin.collections/Iterable<#A>).arrow.fx.coroutines/parMap(kotlin.coroutines/CoroutineContext = ..., kotlin/Int, kotlin.coroutines/SuspendFunction2<kotlinx.coroutines/CoroutineScope, #A, #B>): kotlin.collections/List<#B> // arrow.fx.coroutines/parMap|parMap@kotlin.collections.Iterable<0:0>(kotlin.coroutines.CoroutineContext;kotlin.Int;kotlin.coroutines.SuspendFunction2<kotlinx.coroutines.CoroutineScope,0:0,0:1>){0§<kotlin.Any?>;1§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?, #B: kotlin/Any?> (kotlin.collections/Iterable<#A>).arrow.fx.coroutines/parMapNotNull(kotlin.coroutines/CoroutineContext = ..., kotlin.coroutines/SuspendFunction2<kotlinx.coroutines/CoroutineScope, #A, #B?>): kotlin.collections/List<#B> // arrow.fx.coroutines/parMapNotNull|parMapNotNull@kotlin.collections.Iterable<0:0>(kotlin.coroutines.CoroutineContext;kotlin.coroutines.SuspendFunction2<kotlinx.coroutines.CoroutineScope,0:0,0:1?>){0§<kotlin.Any?>;1§<kotlin.Any?>}[0]
Expand All @@ -170,6 +183,7 @@ final suspend fun <#A: kotlin/Any?, #B: kotlin/Any?> (kotlin.coroutines/SuspendF
final suspend fun <#A: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.fx.coroutines/ResourceScope, #A>).arrow.fx.coroutines/allocated(): kotlin/Pair<#A, kotlin.coroutines/SuspendFunction1<arrow.fx.coroutines/ExitCase, kotlin/Unit>> // arrow.fx.coroutines/allocated|allocated@kotlin.coroutines.SuspendFunction1<arrow.fx.coroutines.ResourceScope,0:0>(){0§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?> (kotlinx.coroutines/CoroutineScope).arrow.fx.coroutines.await/awaitAll(kotlin.coroutines/SuspendFunction1<arrow.fx.coroutines.await/AwaitAllScope, #A>): #A // arrow.fx.coroutines.await/awaitAll|awaitAll@kotlinx.coroutines.CoroutineScope(kotlin.coroutines.SuspendFunction1<arrow.fx.coroutines.await.AwaitAllScope,0:0>){0§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?> arrow.fx.coroutines.await/awaitAll(kotlin.coroutines/SuspendFunction1<arrow.fx.coroutines.await/AwaitAllScope, #A>): #A // arrow.fx.coroutines.await/awaitAll|awaitAll(kotlin.coroutines.SuspendFunction1<arrow.fx.coroutines.await.AwaitAllScope,0:0>){0§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?> arrow.fx.coroutines/racing(kotlin.coroutines/SuspendFunction2<kotlin.coroutines/CoroutineContext, kotlin/Throwable, kotlin/Unit>? = ..., kotlin/Function1<arrow.fx.coroutines/RacingScope<#A>, kotlin/Unit>): #A // arrow.fx.coroutines/racing|racing(kotlin.coroutines.SuspendFunction2<kotlin.coroutines.CoroutineContext,kotlin.Throwable,kotlin.Unit>?;kotlin.Function1<arrow.fx.coroutines.RacingScope<0:0>,kotlin.Unit>){0§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?> arrow.fx.coroutines/resourceScope(kotlin.coroutines/SuspendFunction1<arrow.fx.coroutines/ResourceScope, #A>): #A // arrow.fx.coroutines/resourceScope|resourceScope(kotlin.coroutines.SuspendFunction1<arrow.fx.coroutines.ResourceScope,0:0>){0§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/AutoCloseable> (arrow.fx.coroutines/ResourceScope).arrow.fx.coroutines/autoCloseable(kotlinx.coroutines/CoroutineDispatcher = ..., kotlin.coroutines/SuspendFunction0<#A>): #A // arrow.fx.coroutines/autoCloseable|autoCloseable@arrow.fx.coroutines.ResourceScope(kotlinx.coroutines.CoroutineDispatcher;kotlin.coroutines.SuspendFunction0<0:0>){0§<kotlin.AutoCloseable>}[0]
final suspend fun arrow.fx.coroutines/cancelAndCompose(kotlinx.coroutines/Deferred<*>, kotlinx.coroutines/Deferred<*>) // arrow.fx.coroutines/cancelAndCompose|cancelAndCompose(kotlinx.coroutines.Deferred<*>;kotlinx.coroutines.Deferred<*>){}[0]
Expand Down
Loading