public function receive()
    {
        if (($shmId = @shmop_open($this->pid, 'a', 0, 0)) > 0) {
            $serializedMessages = shmop_read($shmId, 0, shmop_size($shmId));
            shmop_delete($shmId);
            shmop_close($shmId);

            return unserialize($serializedMessages);
        }

        return array();
    }