Module akka_persistence_rs::effect
source · Expand description
Effects that are lazily performed as a result of performing a command of an entity. Effects can be chained with other effects and are guaranteed to be applied (run) before the next command for an entity id is processed.
Convience methods are providing for commonly chained operations, and take
the form of and_then and then as the prefix. By Rust convention, and_then
provides the result of the previous operation and expects a result provided
given some closure. Also by convention, then is applied only when the previous operation
completed successfully.
In the case where there is no convenience method, a generalized and
operation can be used to chain any effect found here, or a customized
effect.
Structs
- The return type of EffectExt::and.
- The return type of persist_event and persist_deletion_event.
- The return type of reply.
- The return type of then.
- The return type of EffectExt::then_persist_event.
- The return type of [EffectExt::and_then_reply].
- The return type of unhandled.
Enums
- Errors that can occur when applying effects.
Traits
- The trait that effect types implement.
- Combinators for use with effects.
Functions
- An effect to persist an event upon having successfully handed it off to be persisted. The event will be flagged to represent the deletion of an entity instance.
- An effect to persist an event.
- An effect to reply an envelope if the previous effect completed successfully. Note that if state from having persisted an event via a prior effect is required, then use a then effect instead.
- A side effect to run a function asynchronously. The associated behavior is available so that communication channels, for example, can be accessed by the side-effect. Additionally, the latest state given any previous effect having persisted an event, or else the state at the outset of the effects being applied, is also available.
- An unhandled command producing no effect
Type Definitions
- The reply-to [oneshot::Sender] and the value to send as a result of some tuple.