Jenner\SimpleFork\Queue\SystemVMessageQueue::get PHP Method

get() public method

get message
public get ( boolean $block = false ) : boolean | string
$block boolean if block when the queue is empty
return boolean | string
    public function get($block = false)
    {
        $queue_status = $this->status();
        if ($queue_status['msg_qnum'] > 0) {
            $option_receive = $block ? 0 : $this->option_receive;
            if (\msg_receive($this->queue, $this->msg_type, $msgtype_erhalten, $this->maxsize, $data, $this->serialize_needed, $option_receive, $err) === true) {
                return $data;
            } else {
                throw new \RuntimeException($err);
            }
        } else {
            return false;
        }
    }