constructor(worker) {
    this.worker = worker;
    this.worker.addEventListener('message', (e) => this._onWorkerMessage(e));
    this.jobIdCounter = 0;
    this.jobs = new Map();
  }
@param {Worker} worker the worker to wrap