AssetChannelMessage

View source

Represents one deferred reference-count operation for a typed asset pool.

AssetChannel queues these operation values for later processing.

Examples

import { AssetChannel, AssetChannelMessageType } from '@wimaengine/asset'

const channel = new AssetChannel()
channel.acquire(17)

const [message] = channel.flush()
console.log(message.type === AssetChannelMessageType.Acquire) // true
console.log(message.assetId) // 17

Constructor


constructor<T>(type: number, assetId: AssetId)

View source

Creates a message by assigning the supplied operation label and asset identity directly to the message.

The constructor does not validate, enqueue, or apply the supplied values.

Type Parameters

T

Parameters

NameDescriptionDefault
type

Operation label to store.

—
assetId

Packed asset identity to store.

—

Properties


readonlyassetId: AssetId

View source

Read-only packed AssetId identifying the asset slot and generation.