EventHandlerEntry

internal sealed interface EventHandlerEntry : Priority

Base type for all registered event handler entries.

An EventHandlerEntry represents a single method annotated with @EventHandler that has been discovered and compiled into an EventInvoker. Concrete implementations distinguish between:

  • instance-bound handlers, tied to a specific subscriber object, and

  • static handlers, declared as static / @JvmStatic on a class.

The event system uses this abstraction to store, sort, and dispatch event handlers without exposing implementation details to consumers.

Cancellation Interaction

The runIfCanceled flag reflects the value of runIfCanceled declared on the original @EventHandler annotation. It defines whether this handler should receive events that have been marked as canceled, depending on the CancelMode specified during dispatch:

This behavior allows fine-grained, per-handler control over whether cancellation should prevent the handler from running.

Inheritors

Properties

Link copied to clipboard
abstract val invoker: EventInvoker

strategy object responsible for invoking the underlying event handler method.

Link copied to clipboard
abstract val priority: Int

execution ordering hint; larger values are dispatched first.

Link copied to clipboard
abstract val runIfCanceled: Boolean

whether this handler should continue to receive events after they have been marked as canceled, subject to the active com.smushytaco.event_library.api.CancelMode.