There is this sentence in the docs, but I can’t make sense of it:
Publishers are created using Dry::Events::Publisher extension, which is created by providing a unique identifier. An extended class can be used to define the type of events it can publish
There’s no public API to do that but it is possible. The reason why it’s a plain Hash is because performance is a great concern here. Creating plain hashes will be multiple times faster than Structs. We could consider adding an API that would allow you to specify payload constructors (as in, something that would build a payload however you want), but it’s a very, very low priority right now. This is a post-1.0.0 type of a feature.
include Dry::Events::Publisher[:my_publisher] returns a module object which is identified by :my_publisher symbol, then it gets included in the Application class and provides register_event class method
register_event defines an event type that you will be able to use with this publisher class