com.github.lemfi.kest.cadence.builder.ActivityCallExecutionBuilder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of step-cadence Show documentation
Show all versions of step-cadence Show documentation
Backends testing with Kotlin
package com.github.lemfi.kest.cadence.builder
import com.github.lemfi.kest.cadence.executor.ActivityExecution
import com.github.lemfi.kest.cadence.model.cadenceProperty
import com.github.lemfi.kest.core.builder.ExecutionBuilder
import com.github.lemfi.kest.core.model.Execution
import com.uber.cadence.context.ContextPropagator
import kotlin.properties.Delegates
import kotlin.reflect.KFunction
class ActivityCallExecutionBuilder(private val cls: Class): ExecutionBuilder() {
lateinit var domain: String
lateinit var tasklist: String
lateinit private var activity: KFunction
private var params: Array? = null
private var contextPropagators: List? = null
var host = cadenceProperty { host }
var port = cadenceProperty { port }
private var withResult: RESULT.()->Unit = {}
fun activity(activity: KFunction, vararg parameters: Any?) {
this.activity = activity
this.params = parameters
}
fun contextPropagators(vararg contextPropagators: ContextPropagator?) {
this.params = contextPropagators
}
fun withResult(l: RESULT.()->Unit) { withResult = l }
override fun build(): Execution {
return ActivityExecution(
host, port, domain, tasklist, cls, activity, params, contextPropagators, withResult
)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy