mirror of
https://github.com/mailscope/kumomta.git
synced 2026-08-21 11:58:17 +00:00
929d51deba
Previously, we'd restrict `kumo.on` to allowing just a single instance of an event to be registered. The purpose of this was to help surface logical errors where copypasta would result in a bogus configuration. With multiple helper lua modules now wanting to take responsibility for some portion of the event handling, it is becoming more complex to stitch things together. It is desirable to allow multiple handlers for certain events, so that a module can handle just its area of responsibility without worry other modules about it. This commit introduces a CallbackSignature type that allows defining the function signature for event callbacks. The signature can be pre-created and registered ahead of setting up any lua contexts, which allows declaring whether an event can have multiple callbacks registered. The `get_queue_config` event handler has been set to allow multiple callbacks.