NovaECS - v1.0.11
    Preparing search index...

    Class EventChannel<T>

    Simple event channel for batching and consuming events 用于批处理和消费事件的简单事件通道

    Type Parameters

    • T
    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • get hasEvents(): boolean

      Check if channel has events 检查通道是否有事件

      Returns boolean

    Methods

    • Clear all events without processing 清空所有事件而不处理

      Returns void

    • Consume all events and clear the queue 逐条消费所有事件并清空队列

      Parameters

      • fn: (event: T) => void

      Returns void

    • Emit an event to the channel 向通道发出事件

      Parameters

      • event: T

      Returns void

    • Take all events and clear the queue (for batch processing) 取出所有事件并清空队列(用于批处理)

      Returns T[]