per

object per

Sentinel object that enables the once per { ctx -> key } infix syntax.

Usage:

first call Step.CHARGE with { ctx -> chargeService.charge(ctx.orderId) }
once per { ctx -> "charge:${ctx.orderId}" }

Calling per { ctx -> key } produces a PerKey which is then passed to the once infix extension on SagaStepConfiguration.

Functions

Link copied to clipboard
operator fun <C> invoke(block: suspend (C) -> String): PerKey<C>

Wraps an effect-key lambda in a PerKey descriptor.