SubscriptionSource

class SubscriptionSource @InternalWowApi constructor(val context: String? = null, val aggregates: List<String> = emptyList(), val events: List<String> = emptyList(), val nullableState: Boolean = false, val eventSchemas: List<String> = emptyList())

What a subscription reads: the aggregates (by name) of context whose state events it receives, and the event names it is limited to. Empty aggregates or events mean no limit; a null context means the handler's state type is not an aggregate of the module that declares it.

context may be another context than the subscription's (@OnEvent(aggregates = ["ctx.agg"])): the subscription then reads that context's published state events (PublishedManifest) instead of the log.

nullableState says the handler takes a null state, StateEvent<S?> or StateEvent<*>: only such a handler may read a stream published without the state (PublishedManifest.includeState = false).

eventSchemas is a fragment's alone: the schemas of another context's events a handler takes by type (StateTypedEvent<V, E>) without naming their aggregate. The service's Manifest finds the context and the aggregates from the peer contracts on its class path (PeerSources) and holds those instead.

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

Constructors

Link copied to clipboard
constructor(context: String? = null, aggregates: List<String> = emptyList(), events: List<String> = emptyList(), nullableState: Boolean = false, eventSchemas: List<String> = emptyList())

Properties

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 SubscriptionSource.copyWith(context: String? = this.context, aggregates: List<String> = this.aggregates, events: List<String> = this.events, nullableState: Boolean = this.nullableState, eventSchemas: List<String> = this.eventSchemas): SubscriptionSource
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