mutableSite

inline fun <T> mutableSite(    identifier: SiteIdentifier,     vararg events: Pair<EventIdentifier, T>,     strategy: SyncStrategy = SyncStrategy.Continuous): MutableSite<T, Unit>

Creates a new MutableSite for the provided SiteIdentifier, with a backing history. The current model value of the site will always be Unit, since it does not perform aggregations.

Parameters

identifier

the globally unique identifier for this Site.

events

some initial events to populate the history.

strategy

the SyncStrategy that's applied. Defaults to SyncStrategy.Continuous.

T

the type of the events managed by this Site.


inline fun <M, T> mutableSite(    identifier: SiteIdentifier,     history: MutableHistory<M>,     strategy: SyncStrategy = SyncStrategy.Continuous): MutableSite<T, M>

Creates a new MutableSite for the provided SiteIdentifier, with a backing log. Additionally, this overload takes a OneWayProjection and lets you specify a projection to apply to the data, to have custom MutableSite.event arguments.

Parameters

identifier

the globally unique identifier for this Site.

history

the MutableHistory backing the site.

strategy

the SyncStrategy that's applied. Defaults to SyncStrategy.Continuous.

M

the type of the model for this Site.

T

the type of the events managed by this Site.


inline fun <M, T> mutableSite(    identifier: SiteIdentifier,     initial: M,     projection: OneWayProjection<M, T>,     vararg events: Pair<EventIdentifier, T>,     strategy: SyncStrategy = SyncStrategy.Continuous): MutableSite<T, M>

Creates a new MutableSite for the provided SiteIdentifier, with a backing log. Additionally, this overload takes a OneWayProjection and lets you specify a projection to apply to the data, to have custom MutableSite.event arguments.

Parameters

identifier

the globally unique identifier for this Site.

initial

the initial value for the projection aggregate.

projection

the OneWayProjection for this Site.

events

some initial events to populate the history.

strategy

the SyncStrategy that's applied. Defaults to SyncStrategy.Continuous.

M

the type of the model for this Site.

T

the type of the events managed by this Site.


inline fun <M, T, C> mutableSite(    identifier: SiteIdentifier,     initial: M,     projection: TwoWayProjection<M, T, C>,     vararg events: Pair<EventIdentifier, T>,     strategy: SyncStrategy = SyncStrategy.Continuous): MutableSite<T, M>

Creates a new MutableSite for the provided SiteIdentifier, with a backing log. Additionally, this overload takes a TwoWayProjection and lets you specify a projection to apply to the data, to have custom MutableSite.event arguments.

Parameters

identifier

the globally unique identifier for this Site.

initial

the initial value for the projection aggregate.

projection

the TwoWayProjection for this Site.

events

some initial events to populate the history.

strategy

the SyncStrategy that's applied. Defaults to SyncStrategy.Continuous.

M

the type of the model for this Site.

T

the type of the events managed by this Site.

C

the type of the changes generated by this Site.


inline fun <M, T, R> mutableSite(    identifier: SiteIdentifier,     history: MutableHistory<R>,     strategy: SyncStrategy = SyncStrategy.Continuous,     noinline transform: (R) -> M): MutableSite<T, M>

Creates a new MutableSite for the provided SiteIdentifier, with a backing mutable history. Additionally, this overload takes a OneWayProjection and lets you specify a projection to apply to the data, to have custom MutableSite.event arguments.

Parameters

identifier

the globally unique identifier for this Site.

history

the MutableHistory backing the site.

strategy

the SyncStrategy that's applied. Defaults to SyncStrategy.Continuous.

transform

a function mapping the backing model from type R to type M.

M

the type of the model for this Site.

T

the type of the events managed by this Site.

R

the type of the backing model for this Site.


inline fun <M, T, R> mutableSite(    identifier: SiteIdentifier,     initial: R,     projection: OneWayProjection<R, T>,     vararg events: Pair<EventIdentifier, T>,     strategy: SyncStrategy = SyncStrategy.Continuous,     noinline transform: (R) -> M): MutableSite<T, M>

Creates a new MutableSite for the provided SiteIdentifier, with a backing mutable history. Additionally, this overload takes a OneWayProjection and lets you specify a projection to apply to the data, to have custom MutableSite.event arguments.

Parameters

identifier

the globally unique identifier for this Site.

initial

the initial value for the projection aggregate.

projection

the OneWayProjection for this Site.

events

some initial events to populate the history.

strategy

the SyncStrategy that's applied. Defaults to SyncStrategy.Continuous.

transform

a function mapping the backing model from type R to type M.

M

the type of the model for this Site.

T

the type of the events managed by this Site.

R

the type of the backing model for this Site.


inline fun <M, T, C, R> mutableSite(    identifier: SiteIdentifier,     initial: R,     projection: TwoWayProjection<R, T, C>,     vararg events: Pair<EventIdentifier, T>,     strategy: SyncStrategy = SyncStrategy.Continuous,     noinline transform: (R) -> M): MutableSite<T, M>

Creates a new MutableSite for the provided SiteIdentifier, with a backing mutable history. Additionally, this overload takes a TwoWayProjection and lets you specify a projection to apply to the data, to have custom MutableSite.event arguments.

Parameters

identifier

the globally unique identifier for this Site.

initial

the initial value for the projection aggregate.

projection

the TwoWayProjection for this Site.

events

some initial events to populate the history.

strategy

the SyncStrategy that's applied. Defaults to SyncStrategy.Continuous.

transform

a function mapping the backing model from type R to type M.

M

the type of the model for this Site.

T

the type of the events managed by this Site.

C

the type of the changes generated by this Site.

R

the type of the backing model for this Site.


fun <M, T, R> mutableSite(    identifier: SiteIdentifier,     history: MutableHistory<R>,     eventSerializer: KSerializer<T>,     format: BinaryFormat = DefaultBinaryFormat,     strategy: SyncStrategy = SyncStrategy.Continuous,     transform: (R) -> M): MutableSite<T, M>

Creates a new MutableSite for the provided SiteIdentifier, with a backing mutable history.

Parameters

identifier

the globally unique identifier for this Site.

history

the underlying MutableHistory.

eventSerializer

the KSerializer for the events.

format

the binary format to use.

strategy

the SyncStrategy that's applied. Defaults to SyncStrategy.Continuous.

transform

a function mapping the backing model from type R to type M.

M

the type of the model for this Site.

T

the type of the events managed by this Site.

R

the type of the backing model for this Site.