Function akka_persistence_rs::effect::then
source · pub fn then<B, F, R>(f: F) -> Then<B, F, R>where
B: EventSourcedBehavior + Send + Sync + 'static,
B::State: Send + Sync,
F: FnOnce(&B, Option<&B::State>, Result) -> R + Send,
R: Future<Output = Result>,
Expand description
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.