protected function enqueue($item)
{
$count = count($this->queue);
if ($count > $this->max_queue_size) {
return false;
}
$count = array_push($this->queue, $item);
if ($count >= $this->batch_size) {
return $this->flush();
// return ->flush() result: true on success
}
return true;
}