def publish
bendvy-ecs-core@0.1.0.3 · execution_relation_store.bend:37
import bendvy-ecs-core@0.1.0.3/execution_relation_store.bend as ExecutionRelationStore
import Base
import bendvy-ecs-core@0.1.0.3/entity_allocator.bend as A
import bendvy-ecs-core@0.1.0.3/relation_types.bend as T
import bendvy-ecs-core@0.1.0.3/execution_relation_operation.bend as O
import bendvy-ecs-core@0.1.0.3/execution_relation_failure_message.bend as Failure
import bendvy-ecs-core@0.1.0.3/execution_stream_channel.bend as Channel
37def publish(~S:Data,~descriptor:T.Descriptor<S>,namespace:U32,graph:T.Graph<S>,failures:Channel.Store<Failure.Message<S,descriptor>>,sequence:Nat,nextReader:U32,allocator:A.Allocator,operation:O.Operation<S>,reason:O.Reason,message:Maybe<&2,Failure.Message<S,descriptor>>) -> A.Allocator & (Store<S,descriptor> & Receipt<S>):
38 match message:
39 case None{}:(allocator,(Store{namespace,graph,failures,sequence,nextReader},Refused{operation,OperationRefused{reason}}))
40 case Some{message}:published(~S,~descriptor,namespace,graph,nextReader,allocator,operation,reason,Channel.push(~Failure.Message<S,descriptor>,sequence,failures,message))