From ea6bddfe2b141fa098e916c0fe4237ec7b789a0c Mon Sep 17 00:00:00 2001 From: himadieievsv Date: Wed, 17 Jan 2024 12:08:03 +0900 Subject: [PATCH] inline List extension executor --- build.gradle.kts | 2 +- .../core/locks/excecutors/MultiInstanceExecutor.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 02d734e..1c498a2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,7 @@ plugins { allprojects { group = "com.himadieiev" - version = "1.1.4" + version = "1.1.5" repositories { mavenCentral() diff --git a/redpulsar-core/src/main/kotlin/com/himadieiev/redpulsar/core/locks/excecutors/MultiInstanceExecutor.kt b/redpulsar-core/src/main/kotlin/com/himadieiev/redpulsar/core/locks/excecutors/MultiInstanceExecutor.kt index f1bfc10..3fdd365 100644 --- a/redpulsar-core/src/main/kotlin/com/himadieiev/redpulsar/core/locks/excecutors/MultiInstanceExecutor.kt +++ b/redpulsar-core/src/main/kotlin/com/himadieiev/redpulsar/core/locks/excecutors/MultiInstanceExecutor.kt @@ -115,15 +115,15 @@ suspend inline fun multiInstanceExecuteWithRetry( } } -suspend fun List.executeWithRetry( +suspend inline fun List.executeWithRetry( scope: CoroutineScope, timeout: Duration, defaultDrift: Duration = Duration.ofMillis(3), retryCount: Int = 3, retryDelay: Duration = Duration.ofMillis(100), - cleanUp: (backend: T) -> Unit = { _ -> }, waitStrategy: WaitStrategy = WaitStrategy.ALL, - callee: suspend (backend: T) -> R, + crossinline cleanUp: (backend: T) -> Unit = { _ -> }, + crossinline callee: suspend (backend: T) -> R, ): List { return multiInstanceExecuteWithRetry( backends = this,