WaitPlan

class WaitPlan @InternalWowApi constructor(val hops: List<Hop>, val timeout: Duration = DEFAULT_TIMEOUT, val isDefault: Boolean = false)

What the caller of a command waits for (–): the hops of a chain, reached in order, within timeout. It stays on the node that took the command; what travels with the command's messages is a wait context instead.

Within one command the stages come in order (accepted, committed, handled); a HANDLED hop of a saga may be followed by more hops, which then apply to the commands that saga derived from the commit. The runtime checks the rest of the chain's shape at admission.

isDefault marks DEFAULT, the plan of a caller that asked for none: it waits for the snapshot, but where the aggregate has no snapshot subscription, its context has none or the aggregate turns its snapshots off (@AggregateRoot(snapshot = false)), it waits for COMMITTED instead. Any other plan is taken as asked, so a snapshot hop the aggregate cannot reach is rejected at admission rather than left to time out. within keeps the mark.

Build a plan with of or take one of the constants, and give it a timeout with within (from Java, its java.time.Duration overload); read it back with javaTimeout. Fields may be added, so the constructor is internal to Wow.

Constructors

Link copied to clipboard
constructor(hops: List<Hop>, timeout: Duration = DEFAULT_TIMEOUT, isDefault: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val hops: List<Hop>
Link copied to clipboard
Link copied to clipboard

timeout as a java.time.Duration.

Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun within(timeout: Duration): WaitPlan
fun within(timeout: Duration): WaitPlan

This plan waiting at most timeout.