diff --git a/code_snippets/kotlin/src/main/kotlin/develop/signals/MyWorkflow.kt b/code_snippets/kotlin/src/main/kotlin/develop/signals/MyWorkflow.kt deleted file mode 100644 index aefa260d..00000000 --- a/code_snippets/kotlin/src/main/kotlin/develop/signals/MyWorkflow.kt +++ /dev/null @@ -1,41 +0,0 @@ -package develop.signals - -import dev.restate.sdk.annotation.Handler -import dev.restate.sdk.annotation.Workflow -import dev.restate.sdk.kotlin.KtDurablePromiseKey -import dev.restate.sdk.kotlin.SharedWorkflowContext -import dev.restate.sdk.kotlin.WorkflowContext - -// -@Workflow -class MyWorkflow { - - companion object { - private val MY_BOOLEAN_SIGNAL = KtDurablePromiseKey.json("my-boolean-signal") - } - - @Workflow - suspend fun run(ctx: WorkflowContext, input: String): String { - - // do some steps... - - // withClass highlight-line - // Creation of the Durable Promise - // withClass highlight-line - val signal: Boolean = ctx.promise(MY_BOOLEAN_SIGNAL).awaitable().await() - - // do some steps... - - return "success" - } - - @Handler - suspend fun resolveMySignal(ctx: SharedWorkflowContext, signal: Boolean) { - // withClass highlight-line - // Resolution of the Durable Promise - // withClass highlight-line - ctx.promiseHandle(MY_BOOLEAN_SIGNAL).resolve(signal) - } - -} -//