Avena Webapp API - v0.0.1
    Preparing search index...

    Function drainChannelQueue

    • Decodes and applies every queued message of one channel, in arrival order.

      For each message: decode, ingestScan, empty the buffer on a reset, append the points, trim to maxPoints, then call onChunk so trigger logic sees each batch right after it is in the buffer.

      Parameters

      • queue: ScanMessageQueue

        Message queue.

      • channel: number

        Channel number.

      • live: LiveChannel

        Channel state; its buffer is changed in place.

      • decode: (payload: ArrayBuffer | Uint8Array<ArrayBufferLike>) => ScanData | null

        Payload decoder, e.g. FlatBufferParser.parse.

      • calibration: CalibrationSpec

        Calibration of the channel.

      • maxPoints: number

        Largest buffer length.

      • OptionalonChunk: (chunkStartIndex: number, reset: boolean, chunk: DataPoint[]) => void

        Called after each applied batch with the index in live.buffer of the batch's first point and whether the buffer was reset first.

      • maxMessages: number = Number.POSITIVE_INFINITY

        Most messages to take in this call. The rest stay queued in order, so draining in several calls gives the same buffer as one call. Default: all of them.

      • filter: LiveChannelFilter | null = null

        The channel's noise filters, or null. Points then reach the buffer through it, a few samples late (see live-filter.ts).

      Returns number

      Number of messages taken from the queue.