Class
MessageCache
Per-channel message cache with FIFO eviction.
Constructor
new MessageCache
(getLimit: () => number)| Param | Type | Description |
|---|---|---|
| getLimit | () => number |
Properties
caches
: Map<string, Map<string, APIMessage>> | nullMethods
add
(channelId: string, data: APIMessage): void| Param | Type | Description |
|---|---|---|
| channelId | string | |
| data | APIMessage |
clearChannel
(channelId: string): void| Param | Type | Description |
|---|---|---|
| channelId | string |
get
(channelId: string): Map<string, APIMessage> | null| Param | Type | Description |
|---|---|---|
| channelId | string |
remove
(channelId: string, messageId: string): void| Param | Type | Description |
|---|---|---|
| channelId | string | |
| messageId | string |
reset
(): voidsweep
(filter?: (message: APIMessage, channelId: string) => boolean, channelId?: string): number| Param | Type | Description |
|---|---|---|
| filter? | (message: APIMessage, channelId: string) => boolean | |
| channelId? | string |