-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Split CircuitBreaker and Schedule into its own package Co-authored-by: Simon Vergauwen <[email protected]>
- Loading branch information
Showing
32 changed files
with
3,083 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
config.set({ | ||
browserDisconnectTimeout: 60000 | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
config.set({ | ||
browserDisconnectTimeout: 60000 | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...s/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/DeprecationWarnings.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package arrow.fx.coroutines | ||
|
||
internal const val deprecatedInFavorOfArrowFxResilience = | ||
"This is now part of the arrow-fx-resilience module, and will be removed from arrow-fx-coroutines in version 2.0. Please update your project dependencies." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Module main | ||
# Arrow Fx Resilience | ||
|
||
[![Arrow Fx logo](https://raw.githubusercontent.com/arrow-kt/arrow-site/main/docs/img/fx/arrow-fx-brand-sidebar.svg?sanitize=true)](https://arrow-kt.io) | ||
|
||
Λrrow Fx Resilience is part of Arrow Fx [**Λrrow**](https://arrow-kt.io/docs/fx/). |
180 changes: 180 additions & 0 deletions
180
arrow-libs/fx/arrow-fx-resilience/api/arrow-fx-resilience.api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
public final class arrow/fx/resilience/CircuitBreaker { | ||
public static final field Companion Larrow/fx/resilience/CircuitBreaker$Companion; | ||
public synthetic fun <init> (Ljava/util/concurrent/atomic/AtomicReference;IDDDLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/internal/DefaultConstructorMarker;)V | ||
public final fun awaitClose (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public final fun doOnClosed (Lkotlin/jvm/functions/Function1;)Larrow/fx/resilience/CircuitBreaker; | ||
public final fun doOnHalfOpen (Lkotlin/jvm/functions/Function1;)Larrow/fx/resilience/CircuitBreaker; | ||
public final fun doOnOpen (Lkotlin/jvm/functions/Function1;)Larrow/fx/resilience/CircuitBreaker; | ||
public final fun doOnRejectedTask (Lkotlin/jvm/functions/Function1;)Larrow/fx/resilience/CircuitBreaker; | ||
public final fun protectEither (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public final fun protectOrThrow (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public final fun state (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
} | ||
|
||
public final class arrow/fx/resilience/CircuitBreaker$Companion { | ||
public final fun of (IDDDLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public static synthetic fun of$default (Larrow/fx/resilience/CircuitBreaker$Companion;IDDDLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; | ||
public final fun of-3c68mSE (IJDJLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public static synthetic fun of-3c68mSE$default (Larrow/fx/resilience/CircuitBreaker$Companion;IJDJLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; | ||
} | ||
|
||
public final class arrow/fx/resilience/CircuitBreaker$ExecutionRejected : java/lang/Throwable { | ||
public fun <init> (Ljava/lang/String;Larrow/fx/resilience/CircuitBreaker$State;)V | ||
public final fun getReason ()Ljava/lang/String; | ||
public final fun getState ()Larrow/fx/resilience/CircuitBreaker$State; | ||
} | ||
|
||
public abstract class arrow/fx/resilience/CircuitBreaker$State { | ||
} | ||
|
||
public final class arrow/fx/resilience/CircuitBreaker$State$Closed : arrow/fx/resilience/CircuitBreaker$State { | ||
public fun <init> (I)V | ||
public fun equals (Ljava/lang/Object;)Z | ||
public final fun getFailures ()I | ||
public fun hashCode ()I | ||
public fun toString ()Ljava/lang/String; | ||
} | ||
|
||
public final class arrow/fx/resilience/CircuitBreaker$State$HalfOpen : arrow/fx/resilience/CircuitBreaker$State { | ||
public fun <init> (D)V | ||
public synthetic fun <init> (JLkotlin/jvm/internal/DefaultConstructorMarker;)V | ||
public fun equals (Ljava/lang/Object;)Z | ||
public final fun getResetTimeout-UwyO8pc ()J | ||
public final fun getResetTimeoutNanos ()D | ||
public fun hashCode ()I | ||
public fun toString ()Ljava/lang/String; | ||
} | ||
|
||
public final class arrow/fx/resilience/CircuitBreaker$State$Open : arrow/fx/resilience/CircuitBreaker$State { | ||
public fun <init> (JD)V | ||
public synthetic fun <init> (JJLkotlin/jvm/internal/DefaultConstructorMarker;)V | ||
public fun equals (Ljava/lang/Object;)Z | ||
public final fun getExpiresAt ()J | ||
public final fun getResetTimeout-UwyO8pc ()J | ||
public final fun getResetTimeoutNanos ()D | ||
public final fun getStartedAt ()J | ||
public fun hashCode ()I | ||
public fun toString ()Ljava/lang/String; | ||
} | ||
|
||
public final class arrow/fx/resilience/FlowKt { | ||
public static final fun retry (Lkotlinx/coroutines/flow/Flow;Larrow/fx/resilience/Schedule;)Lkotlinx/coroutines/flow/Flow; | ||
} | ||
|
||
public abstract class arrow/fx/resilience/Schedule { | ||
public static final field Companion Larrow/fx/resilience/Schedule$Companion; | ||
public final fun and (Larrow/fx/resilience/Schedule;)Larrow/fx/resilience/Schedule; | ||
public abstract fun andThen (Larrow/fx/resilience/Schedule;)Larrow/fx/resilience/Schedule; | ||
public abstract fun check (Lkotlin/jvm/functions/Function3;)Larrow/fx/resilience/Schedule; | ||
public abstract fun choose (Larrow/fx/resilience/Schedule;)Larrow/fx/resilience/Schedule; | ||
public final fun collect ()Larrow/fx/resilience/Schedule; | ||
public final fun combine (Larrow/fx/resilience/Schedule;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public abstract fun combineNanos (Larrow/fx/resilience/Schedule;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public final fun compose (Larrow/fx/resilience/Schedule;)Larrow/fx/resilience/Schedule; | ||
public final fun const (Ljava/lang/Object;)Larrow/fx/resilience/Schedule; | ||
public abstract fun contramap (Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public final fun delay (Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public final fun delayedNanos (Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public final fun dimap (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;)Larrow/fx/resilience/Schedule; | ||
public final fun fold (Ljava/lang/Object;Lkotlin/jvm/functions/Function3;)Larrow/fx/resilience/Schedule; | ||
public abstract fun foldLazy (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;)Larrow/fx/resilience/Schedule; | ||
public abstract fun forever ()Larrow/fx/resilience/Schedule; | ||
public final fun jittered (Lkotlin/jvm/functions/Function1;)Larrow/fx/resilience/Schedule; | ||
public final fun jittered (Lkotlin/random/Random;)Larrow/fx/resilience/Schedule; | ||
public static synthetic fun jittered$default (Larrow/fx/resilience/Schedule;Lkotlin/random/Random;ILjava/lang/Object;)Larrow/fx/resilience/Schedule; | ||
public final fun jitteredDuration (Lkotlin/jvm/functions/Function1;)Larrow/fx/resilience/Schedule; | ||
public abstract fun logInput (Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public abstract fun logOutput (Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public abstract fun map (Lkotlin/jvm/functions/Function1;)Larrow/fx/resilience/Schedule; | ||
public final fun modify (Lkotlin/jvm/functions/Function3;)Larrow/fx/resilience/Schedule; | ||
public abstract fun modifyNanos (Lkotlin/jvm/functions/Function3;)Larrow/fx/resilience/Schedule; | ||
public abstract fun not ()Larrow/fx/resilience/Schedule; | ||
public final fun or (Larrow/fx/resilience/Schedule;)Larrow/fx/resilience/Schedule; | ||
public abstract fun pipe (Larrow/fx/resilience/Schedule;)Larrow/fx/resilience/Schedule; | ||
public final fun repeat (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public final fun repeatAsFlow (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public final fun repeatOrElse (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public final fun repeatOrElseAsFlow (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public abstract fun repeatOrElseEither (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public abstract fun repeatOrElseEitherAsFlow (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public final fun untilInput (Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public final fun untilOutput (Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public final fun void ()Larrow/fx/resilience/Schedule; | ||
public final fun whileInput (Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public final fun whileOutput (Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public final fun zip (Larrow/fx/resilience/Schedule;)Larrow/fx/resilience/Schedule; | ||
public abstract fun zip (Larrow/fx/resilience/Schedule;Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public final fun zipLeft (Larrow/fx/resilience/Schedule;)Larrow/fx/resilience/Schedule; | ||
public final fun zipRight (Larrow/fx/resilience/Schedule;)Larrow/fx/resilience/Schedule; | ||
} | ||
|
||
public final class arrow/fx/resilience/Schedule$Companion { | ||
public final fun collect ()Larrow/fx/resilience/Schedule; | ||
public final fun decision ()Larrow/fx/resilience/Schedule; | ||
public final fun delayInNanos ()Larrow/fx/resilience/Schedule; | ||
public final fun delayedDuration (Larrow/fx/resilience/Schedule;)Larrow/fx/resilience/Schedule; | ||
public final fun delayedNanos (Larrow/fx/resilience/Schedule;)Larrow/fx/resilience/Schedule; | ||
public final fun doUntil (Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public final fun doWhile (Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public final fun duration ()Larrow/fx/resilience/Schedule; | ||
public final fun exponential (DD)Larrow/fx/resilience/Schedule; | ||
public static synthetic fun exponential$default (Larrow/fx/resilience/Schedule$Companion;DDILjava/lang/Object;)Larrow/fx/resilience/Schedule; | ||
public final fun exponential-VtjQ1oo (JD)Larrow/fx/resilience/Schedule; | ||
public static synthetic fun exponential-VtjQ1oo$default (Larrow/fx/resilience/Schedule$Companion;JDILjava/lang/Object;)Larrow/fx/resilience/Schedule; | ||
public final fun fibonacci (D)Larrow/fx/resilience/Schedule; | ||
public final fun fibonacci-LRDsOJo (J)Larrow/fx/resilience/Schedule; | ||
public final fun forever ()Larrow/fx/resilience/Schedule; | ||
public final fun identity ()Larrow/fx/resilience/Schedule; | ||
public final fun invoke (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;)Larrow/fx/resilience/Schedule; | ||
public final fun linear (D)Larrow/fx/resilience/Schedule; | ||
public final fun linear-LRDsOJo (J)Larrow/fx/resilience/Schedule; | ||
public final fun logInput (Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public final fun logOutput (Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public final fun never ()Larrow/fx/resilience/Schedule; | ||
public final fun once ()Larrow/fx/resilience/Schedule; | ||
public final fun recurs (I)Larrow/fx/resilience/Schedule; | ||
public final fun spaced (D)Larrow/fx/resilience/Schedule; | ||
public final fun spaced-LRDsOJo (J)Larrow/fx/resilience/Schedule; | ||
public final fun unfold (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Larrow/fx/resilience/Schedule; | ||
public final fun unfoldLazy (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule; | ||
public final fun unit ()Larrow/fx/resilience/Schedule; | ||
} | ||
|
||
public final class arrow/fx/resilience/Schedule$Decision { | ||
public static final field Companion Larrow/fx/resilience/Schedule$Decision$Companion; | ||
public fun <init> (ZDLjava/lang/Object;Larrow/core/Eval;)V | ||
public final fun bimap (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Larrow/fx/resilience/Schedule$Decision; | ||
public final fun combine (Larrow/fx/resilience/Schedule$Decision;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule$Decision; | ||
public final fun combineNanos (Larrow/fx/resilience/Schedule$Decision;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Larrow/fx/resilience/Schedule$Decision; | ||
public final fun component1 ()Z | ||
public final fun component2 ()D | ||
public final fun component3 ()Ljava/lang/Object; | ||
public final fun component4 ()Larrow/core/Eval; | ||
public final fun copy (ZDLjava/lang/Object;Larrow/core/Eval;)Larrow/fx/resilience/Schedule$Decision; | ||
public static synthetic fun copy$default (Larrow/fx/resilience/Schedule$Decision;ZDLjava/lang/Object;Larrow/core/Eval;ILjava/lang/Object;)Larrow/fx/resilience/Schedule$Decision; | ||
public fun equals (Ljava/lang/Object;)Z | ||
public final fun getCont ()Z | ||
public final fun getDelayInNanos ()D | ||
public final fun getDuration-UwyO8pc ()J | ||
public final fun getFinish ()Larrow/core/Eval; | ||
public final fun getState ()Ljava/lang/Object; | ||
public fun hashCode ()I | ||
public final fun map (Lkotlin/jvm/functions/Function1;)Larrow/fx/resilience/Schedule$Decision; | ||
public final fun mapLeft (Lkotlin/jvm/functions/Function1;)Larrow/fx/resilience/Schedule$Decision; | ||
public final fun not ()Larrow/fx/resilience/Schedule$Decision; | ||
public fun toString ()Ljava/lang/String; | ||
} | ||
|
||
public final class arrow/fx/resilience/Schedule$Decision$Companion { | ||
public final fun cont (DLjava/lang/Object;Larrow/core/Eval;)Larrow/fx/resilience/Schedule$Decision; | ||
public final fun cont-KLykuaI (JLjava/lang/Object;Larrow/core/Eval;)Larrow/fx/resilience/Schedule$Decision; | ||
public final fun done (DLjava/lang/Object;Larrow/core/Eval;)Larrow/fx/resilience/Schedule$Decision; | ||
public final fun done-KLykuaI (JLjava/lang/Object;Larrow/core/Eval;)Larrow/fx/resilience/Schedule$Decision; | ||
} | ||
|
||
public final class arrow/fx/resilience/ScheduleKt { | ||
public static final fun retry (Larrow/fx/resilience/Schedule;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public static final fun retryOrElse (Larrow/fx/resilience/Schedule;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public static final fun retryOrElseEither (Larrow/fx/resilience/Schedule;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
plugins { | ||
id(libs.plugins.kotlin.multiplatform.get().pluginId) | ||
alias(libs.plugins.arrowGradleConfig.kotlin) | ||
alias(libs.plugins.arrowGradleConfig.publish) | ||
} | ||
|
||
apply(plugin = "io.kotest.multiplatform") | ||
apply(from = property("TEST_COVERAGE")) | ||
|
||
val enableCompatibilityMetadataVariant = | ||
providers.gradleProperty("kotlin.mpp.enableCompatibilityMetadataVariant") | ||
.forUseAtConfigurationTime().orNull?.toBoolean() == true | ||
|
||
if (enableCompatibilityMetadataVariant) { | ||
tasks.withType<Test>().configureEach { | ||
exclude("**/*") | ||
} | ||
} | ||
|
||
kotlin { | ||
sourceSets { | ||
commonMain { | ||
dependencies { | ||
api(projects.arrowCore) | ||
implementation(projects.arrowFxCoroutines) | ||
compileOnly(libs.kotlin.stdlibCommon) | ||
implementation(libs.coroutines.core) | ||
} | ||
} | ||
if (!enableCompatibilityMetadataVariant) { | ||
commonTest { | ||
dependencies { | ||
implementation(libs.coroutines.test) | ||
implementation(libs.kotest.frameworkEngine) | ||
implementation(libs.kotest.assertionsCore) | ||
implementation(libs.kotest.property) | ||
} | ||
} | ||
jvmTest { | ||
dependencies { | ||
runtimeOnly(libs.kotest.runnerJUnit5) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Maven publishing configuration | ||
pom.name=Arrow-Fx-Resilience |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
config.set({ | ||
browserDisconnectTimeout: 60000 | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
knit.package=arrow.fx.resilience.examples | ||
knit.dir=src/jvmTest/kotlin/examples/ | ||
|
||
test.package=arrow.fx.resilience.examples.test | ||
test.dir=src/jvmTest/kotlin/examples/autogenerated/ |
Oops, something went wrong.