public function receive($subscriber_id = null, $limit = -1)
    {
        if ($subscriber_id !== null) {
            throw new NotSupportedException('Not implemented. System V queues does not support subscriptions.');
        }
        $flags = $this->blocking ? 0 : MSG_IPC_NOWAIT;
        $messages = [];
        $count = 0;
        while (($limit == -1 || $count < $limit) && (msg_receive($this->getQueue(), 0, $msgtype, self::MSG_MAXSIZE, $message, true, $flags, $errorcode))) {
            $message->subscriber_id = $subscriber_id;
            $message->status = Message::AVAILABLE;
            $messages[] = $message;
            $count++;
        }

        return $messages;
    }