InstanceEventHandlerEntry

internal data class InstanceEventHandlerEntry(val target: WeakReference<Any>, val invoker: InstanceEventInvoker, val priority: Int, val runIfCanceled: Boolean) : EventHandlerEntry

Internal representation of an instance-based event handler.

An InstanceEventHandlerEntry binds a discovered handler method to a specific subscriber object. The subscriber is referenced via a WeakReference, allowing it to be garbage-collected without requiring an explicit unsubscribe call. When the target is collected, the handler is automatically pruned during normal event dispatch or cache maintenance.

Constructors

Link copied to clipboard
constructor(target: WeakReference<Any>, invoker: InstanceEventInvoker, priority: Int, runIfCanceled: Boolean)

Properties

Link copied to clipboard
open override val invoker: InstanceEventInvoker

a precompiled InstanceEventInvoker that performs the actual call to the instance handler method on target.

Link copied to clipboard
open override val priority: Int

execution ordering hint used when multiple handlers listen to the same event type; higher values are invoked first.

Link copied to clipboard
open override 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.

Link copied to clipboard

a weak reference to the subscriber object that owns the handler method. If this reference is cleared, the handler is treated as invalid and skipped.