-

@ mleku
2025-04-15 06:35:29
#realy #devstr #progressreport
i finally did it, i abstracted the handler for publishing to subscribers... it was really tricky to get it all straight it my mind how to do it but i eventually figured out that i needed to make a "Type" method for both the message types and the handler (i just embed it into the publisher implementations and then the third interface, the abstract one, uses it to identify the type of the message and match it to the type of the publisher, and voila
a few more things to fully complete the build-time capability to disable one or the other
first i need to put the publishers into their respective API implementations
next i create an interface for them that includes the publsher interfaces and maybe some other part somehow, maybe again just the type thing
then in the relay instead of explicitly specifying which of the interfaces are available, it calls the registry to get the list of ones that have run their registration at startup
then i can disable one or the other interface with a build tag, and it's all automagical
and it means then that the APIs become an interface and in the future i can make new apis really easily, by implementing those key interfaces that compose the api interface and add their registration and build tag and voila, everything loosely coupled and modular, as it should be