EventHandlerList

platypus. EventHandlerList

new EventHandlerList()

Maintains an ordered list of event handlers for a single event type.

EventHandlerList supports:

  • listener priorities
  • deterministic insertion ordering
  • safe mutation during dispatch
  • one-time listeners
  • recyclable pooled handlers

Handlers are lazily sorted on first dispatch after modification.

Source:

Methods

(static) recycle(eventHandlerList)

Returns EventHandlerList back to cache. If the instance has outstanding holds, the recycle is deferred until all holds are released.

Prefer calling eventHandlerList.recycle() instead of direct pool access.

Source:
Parameters:
Name Type Description
eventHandlerList platypus.EventHandlerList

(static) recycleHold(eventHandlerList) → {platypus.EventHandlerList}

Increments the hold count on the instance, preventing recycling until all holds are released. Returns the instance for chaining.

Source:
Parameters:
Name Type Description
eventHandlerList platypus.EventHandlerList
Returns:
Type:
platypus.EventHandlerList

(static) recycleRelease(eventHandlerList) → {platypus.EventHandlerList}

Decrements the hold count. When it reaches zero, any pending recycle is flushed. Returns the instance for chaining.

Source:
Parameters:
Name Type Description
eventHandlerList platypus.EventHandlerList
Returns:
Type:
platypus.EventHandlerList

(static) setUp() → {platypus.EventHandlerList}

Returns EventHandlerList from cache or creates a new one.

Source:
Returns:
Type:
platypus.EventHandlerList

recycle()

Clears internal references and recycles the instance. If the instance has outstanding holds, the recycle is deferred until all holds are released.

Source:

recycleHold() → {platypus.EventHandlerList}

Increments the hold count on the instance, preventing recycling until all holds are released. Returns the instance for chaining.

Source:
Returns:
Type:
platypus.EventHandlerList

recycleRelease() → {platypus.EventHandlerList}

Decrements the hold count. When it reaches zero, any pending recycle is flushed. Returns the instance for chaining.

Source:
Returns:
Type:
platypus.EventHandlerList