Interface RunInterceptor

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@Experimental @FunctionalInterface public interface RunInterceptor
Wraps the execution of a Restate.run(java.lang.String, java.lang.Class<T>, dev.restate.common.function.ThrowingSupplier<T>) closure. Implementations must invoke RunInterceptor.Next.proceed() 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.