RunInterceptor

@ApiStatus.Experimental
fun interface RunInterceptor

Wraps the execution of a runBlock closure. Implementations must invoke next() exactly once.

Only invoked when the run closure actually executes; replayed runs are skipped by the runner, so this interceptor is never called during replay.

Errors visible to the interceptor

The interceptor sees user code throwables and serialization failures unchanged. Whatever the outermost interceptor rethrows is what Restate's retry machinery sees.

Types

Link copied to clipboard
@ApiStatus.Experimental
data class Context(val request: HandlerRequest, val runName: String?)

Per-ctx.run call context exposed to a RunInterceptor.

Link copied to clipboard
@ApiStatus.Experimental
fun interface Factory

Factory for RunInterceptor.

Functions

Link copied to clipboard
abstract suspend fun aroundRun(context: RunInterceptor.Context, next: suspend () -> Unit)