public function cancelJob(ObjectId $id): bool
    {
        $result = $this->updateJob($id, JobInterface::STATUS_CANCELED);

        if (1 !== $result->getMatchedCount()) {
            throw new JobNotFoundException('job '.$id.' was not found');
        }

        $this->db->{$this->event_queue}->insertOne([
            'job' => $id,
            'status' => JobInterface::STATUS_CANCELED,
            'timestamp' => new UTCDateTime(),
        ]);

        return true;
    }