src/common/emitter.ts/Emitter/emit
class Emitter:  public async emit(value: T): Promise<void> {
    let resolve: () => void
    const promise = new Promise<void>((r) => (resolve = r))

    await Promise.all(
      this.listeners.map(async (cb) => {
        try {
          await cb(value, promise)
        } catch (error: any) {
          logger.error(error.message)
        }
      }),
    )

    resolve!()
  }