Skip to main content

emit_effect

Function emit_effect 

Source
pub fn emit_effect(effect: impl Effect)
Expand description

Emits an effect to be applied. The effect is executed once Effects::apply is called (see take_effects).

The effect will only executed once. The effect is executed outside of the current task and can’t read any Vcs. These need to be read before. ReadRefs can be passed into the effect.

Effects are executed in parallel, so they might need to use async locking to avoid problems. Order of execution of multiple effects is not defined. You must not use multiple conflicting effects to avoid non-deterministic behavior.