public function delete($id)
{
$success = false;
if (isset($this->filePointerList[$id])) {
$fileName = $id;
$path = substr(hash('md5', (string) $fileName), 0, 3);
$fs = new Filesystem();
$fs->remove($this->queuePath . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $fileName . '.json');
fclose($this->filePointerList[$id]);
unset($this->filePointerList[$id]);
$success = true;
}
if (rand(1, 10) === 5) {
$this->cleanUp();
}
return $success;
}