SubscriptionManifest

class SubscriptionManifest @InternalWowApi constructor(val name: String, val kind: SubscriptionKind, val source: SubscriptionSource, val function: FunctionManifest, val derives: List<String>? = null, val rejected: List<String>? = null, val start: SubscriptionStart? = null, val schedules: List<String>? = null, val retry: RetryManifest? = null, val committed: List<String>? = null, val job: JobManifest? = null, val calls: List<String>? = null)

A subscription: one handler of a processor, named processor.function.

  • derives names the commands a saga's handler may derive, any of its kinds: those its @Sends(derives) declares, else those its return type names (CommandRequest<X>, a list of them), empty when it returns Unit; null for a projection or a reactor. A wait chain may follow the saga's hop only into the contexts of these commands.

  • rejected is set on an @OnRejected handler of a saga and on no other: the commands whose rejections it handles, the one its receipt's C names, or empty for any command the saga sends. Such a handler reads rejections, not state events: its source is empty and not read.

  • committed is set on an @OnCommitted handler of a saga and on no other: the commands whose success receipts it handles, the one its receipt's C names, or empty for any command the saga sends. Like an @OnRejected handler, it reads receipts (isReceiptHandler), not state events. A handler of both receipts, annotated both, has both set.

  • start is where a new subscription starts in the log: what @OnEvent(start) declares, else SubscriptionStart.defaultFor its kind and source; the host may configure another. Null on an @OnRejected or @OnCommitted handler, which reads no log.

  • schedules names the commands a saga's handler may schedule, as its @Sends(schedules) declares; null when it declares none, and always for a projection or a reactor.

  • retry is the handler's own in-process retry budget, as its @Retry and its processor's declare it: null when neither does. The host's wow.subscriptions.[<context>.<name>].retry.* overrides it, setting by setting.

  • job is the job of a saga's @OnSchedule handler: its subscription reads the context's built-in job aggregate <context>.schedule (source) and hands its job's ticks to the handler. Null for an @OnEvent handler.

  • calls names the commands a saga's handler sends to another context with SagaContext.call, as its @Sends(calls) declares, each referred to as derives refers to a command; null when it declares none. A wait chain may follow the saga's hop into their contexts too, but they need no command topic: the node calls their gateways, at the addresses its host configures.

A command of derives, calls, rejected, committed or schedules is referred to by its name on the wire, its full type name (inventory.stock.ReserveStock) or a system command's system name (wow.lifecycle.TransferOwner), where the writer can name it; otherwise by the schema reference of its class (#/$defs/<binary name>), whose schema the document keeps (Manifest.schemaRefs), so no reference dangles. A module's fragment refers by class to a command its module does not decide, and so does a context's peer contract, which keeps its fragment's references. A service's Manifest names each by the one command of that class a context of the service or a peer contract on its class path decides (CommandReferences), and keeps the class when several commands share it or none of those decides it. A reader reads both spellings.

Fields may be added: pass the constructor's arguments by name.

Constructors

Link copied to clipboard
constructor(name: String, kind: SubscriptionKind, source: SubscriptionSource, function: FunctionManifest, derives: List<String>? = null, rejected: List<String>? = null, start: SubscriptionStart? = null, schedules: List<String>? = null, retry: RetryManifest? = null, committed: List<String>? = null, job: JobManifest? = null, calls: List<String>? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Whether it is a saga's @OnRejected or @OnCommitted handler: it reads receipts, not the log.

Link copied to clipboard

Whether a wait chain can follow it: a handled hop may name it, the contract's Wait object names it, and a node accepts it. A subscription is a hop when it handles a commit: an event handler (of the log, a job's included), and an @OnCommitted handler, which the success receipt of a command it answers signals. An @OnRejected handler alone is not: the rejection it handles ended the wait. A handler of both receipts handles a commit, so it is one.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun SubscriptionManifest.copyWith(name: String = this.name, kind: SubscriptionKind = this.kind, source: SubscriptionSource = this.source, function: FunctionManifest = this.function, derives: List<String>? = this.derives, rejected: List<String>? = this.rejected, start: SubscriptionStart? = this.start, schedules: List<String>? = this.schedules, retry: RetryManifest? = this.retry, committed: List<String>? = this.committed, job: JobManifest? = this.job, calls: List<String>? = this.calls): SubscriptionManifest
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