Skip to content

Listener Priority Considerations #9

Description

@ZeroMemes

Currently, Listener priority for events is only used for sorting Listener instances in ListenerGroup. This works fine if a single event bus is being used without super listeners. However, when an event is posted to an attachable event bus, the attachable bus will dispatch the event to all of it's registered listeners before any of the children receive it, regardless of priority. Similarly, if super listeners are being used, the listeners subscribing to the exact type of an event will receive the event first, regardless of whether a listener of a super type is subscribed with a higher priority.

Ideally, some sort of mechanism for "global" listener priority should exist to solve this issue. The only way I can think of implementing this is through a multi-stage event dispatch, but that would likely require a small number of fixed event priorities, rather than any arbitrary integer value.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions