12345678910111213141516171819202122232425262728293031323334353637383940open!Coreopen!AsyncopenBonsai_chat_open_source_commontypet={message_bus:(Message.t->unit)Bus.Read_write.t;messages:Message.tQueue.tRoom.Table.t}letcreate()=letmessage_bus=Bus.create_exn[%here]Arity1~on_subscription_after_first_write:Allow~on_callback_raise:(funerror->print_s[%sexp(error:Error.t)])inletinitial_messages=[Message.{room=Room.of_string"incr_dom-room";author="Bonsai Developers";contents="hello world!"};Message.{room=Room.of_string"incr_dom-room";author="Bonsai Developers";contents="For deep and complex security purposes your messages will be hashed so that \
you can't use this platform for actual chatting"}]inletmessages=Room.Table.of_alist_exn[Room.of_string"incr_dom-room",Queue.of_listinitial_messages;Room.of_string"bonsai-room",Queue.of_listinitial_messages]in{message_bus;messages};;