Class

MessageCache

Per-channel message cache with FIFO eviction.

Constructor

new MessageCache(getLimit: () => number)
ParamTypeDescription
getLimit() => number

Properties

caches: Map<string, Map<string, APIMessage>> | null

Methods

add(channelId: string, data: APIMessage): void
ParamTypeDescription
channelIdstring
dataAPIMessage
clearChannel(channelId: string): void
ParamTypeDescription
channelIdstring
get(channelId: string): Map<string, APIMessage> | null
ParamTypeDescription
channelIdstring
remove(channelId: string, messageId: string): void
ParamTypeDescription
channelIdstring
messageIdstring
reset(): void
sweep(filter?: (message: APIMessage, channelId: string) => boolean, channelId?: string): number
ParamTypeDescription
filter?(message: APIMessage, channelId: string) => boolean
channelId?string