By “schema ID” I’m referring to what you call kind in your examples. My code currently denotes this as SCHEMA_ID in my dataclasses. This is what I put in logger.log()'s msg argument. “Relevancy check” is your match record.msg statement.
I haven’t observed a performance hit, it’s just my standard thinking process of shaving off cycles when possible. I assume a module could emit many different schemas, and I know Logger will call the emit() of every handler under it, that this is a blocking call during which the rest of the thread is idle, and that handlers only care about specific msg values. The broker is a lightweight class that shaves off cycles by filtering msg at the very start, only calling emit() of handlers that subscribed to that msg value. The rest of my rationale are mere nice-to-haves. Making the broker a singleton classvar was however probably unwarranted.
My day job is quite unforgiving about worst-case scenarios, so maybe I am overthinking it too. If you conclude that the broker is unnecessary, I don’t mind at all axing it and turning the consumers into handlers directly.
Side-question; you wrote the message below earlier this year, is snapshots.{__name__} still on your mind?