import IORedis from 'ioredis';
import { Job, Queue, Worker } from 'bullmq'
import CharacterJoin from '../events/zone/characterJoin'
import config from '../utilities/config'

class QueueManager {
  private connection!: IORedis;
  public queue!: Queue;
  public worker!: Worker;

  public boot() {
    this.connection = new IORedis(config.REDIS_URL, {
      maxRetriesPerRequest: null
    });
  //   this.queue = new Queue('myqueue', { connection: this.connection });
  //   this.worker = new Worker('myqueue', async (job: Job)=>{
  //     console.log('hallo')
  //     console.log(job.data);
  //     console.log(job.data.data.classobj);
  //     const test = job.data.data.classobj();
  //     console.log(test);
  //     console.log(job.data);
  //   }, { connection: this.connection, concurrency: 10000 });
  //

    console.log('hallo')
  }
}

export default new QueueManager();