DefaultQueueStore

The Default Queue Store, stores the queue in-process using MiniMap, which extends Map That's the fastest Store possibility, but not the most flexible one.

Please Note, the Queue is always "cached" on the client side, which means it's still quite fast, however, the speed of "saving and syncing" depends on the StoreManager.

Here is a List of External Stores I'd recommend:

import { DefaultQueueStore } from "lavalink-client";
export class DefaultQueueStore implements QueueStoreManager {
  private data = new MiniMap();
  constructor() {

  }
  async get(guildId) {
    return await this.data.get(guildId);
  }
  async set(guildId, stringifiedValue) {
    return await this.data.set(guildId, stringifiedValue)
  }
  async delete(guildId) {
    return await this.data.delete(guildId);
  }
  async stringify(value) {
    return value; // JSON.stringify(value);
  }
  async parse(value) {
    return value as Partial<StoredQueue>; // JSON.parse(value)
  }
}

Last updated