def publish

bendvy-ecs-core@0.1.0.3 · execution_event_family.bend:57

import bendvy-ecs-core@0.1.0.3/execution_event_family.bend as ExecutionEventFamily
import Base
import bendvy-ecs-core@0.1.0.3/owned_event_log.bend as Log

57# Publication updates the owned log immediately, as Bevy Messages.write does.
58# https://github.com/bevyengine/bevy/blob/ad678262ce53b5d142fe49ee5e08caff6f00ab60/crates/bevy_ecs/src/message/messages.rs#L120-L143
59# A later handled body error does not stage or undo this already-authored send.
60def publish(~S:Data,~P:Type,~key:String,family:Family<S,P,key>,payload:P) -> Family<S,P,key> & Publication<P>:
61  match family:
62    case Family{identity,False{},log,previous,current,nextReader,active,dropped}:(Family{identity,False{},log,previous,current,nextReader,active,dropped},PublicationRefused{payload})
63    case Family{identity,True{},log,previous,current,nextReader,active,dropped}:published(~S,~P,~key,identity,previous,current,nextReader,active,dropped,Log.append(~P,log,payload))

Uses (8)

Used by (0)

No other definition uses this definition.