Core · class
MessageQueue
Explained in The loop.
class MessageQueue<T extends QueuedMessage = QueuedMessage>import { MessageQueue } from '@driftengine/core';Constructor
new
constructor(options?: MessageQueueOptions)| Parameter | Type | Description |
|---|---|---|
options? | MessageQueueOptions |
Accessors
| Name | Type | Description |
|---|---|---|
currentget | T | null |
Methods
push
push(message: T): void| Parameter | Type | Description |
|---|---|---|
message | T |
update
update(nowMs: number): T | nullAdvance. Returns a message only on the frame it becomes current, so the caller can render it once rather than diffing against what it drew last.
| Parameter | Type | Description |
|---|---|---|
nowMs | number |
clear
clear(): voidDrop everything, including what is on screen — as a restart must.