pub const MESSAGING: &str = "\"messaging bus, aka event bus\";\n\nconstruct messaging namespace {\n\tMessage\n\tBus\n}\n\nconstruct messaging:Message {\n\tname\n\tcontent\n\t;\n\tconstruct { this | with name content this ;\n\t\tname this:=name\n\t\tcontent this:=content\n\t\tthis\n\t}\n}\n\nconstruct messaging:Bus {\n\tsubscribers\n\t;\n\tconstruct { this | with this ;\n\t\tMicroMap:new this:=subscribers\n\t\tthis\n\t}\n\tsubscribe { | with message callable this ;\n\t\tdef entry message this:subscribers:get-or-create-entry =entry\n\t\tentry:1 null eq if {\n\t\t\tList:new entry:=1\n\t\t}\n\t\tcallable entry:1:push\n\t}\n\tpublish { | with message this ;\n\t\tmessage gettype messaging:Message eq not if {\n\t\t\tmessage null messaging:Message:new =message\n\t\t}\n\t\tdef entry message:name this:subscribers:get =entry\n\t\tentry null eq not if {\n\t\t\t{ | with it ;\n\t\t\t\tmessage it call\n\t\t\t} entry:foreach\n\t\t}\n\t}\n}\n";