DominionEnterprises\Mongo\Queue::ack PHP Method

ack() public method

Acknowledge a message was processed and remove from queue.
public ack ( array $message ) : void
$message array message received from get()
return void
    public function ack(array $message)
    {
        $id = null;
        if (array_key_exists('id', $message)) {
            $id = $message['id'];
        }
        if (!is_a($id, 'MongoDB\\BSON\\ObjectID')) {
            throw new \InvalidArgumentException('$message does not have a field "id" that is a ObjectID');
        }
        $this->collection->deleteOne(['_id' => $id]);
    }