public function register_callback_func($argList, $methodName)
    {
        if (is_array($argList) && count($argList) > 1) {
            if ($argList[1] === -2) {
                $this->internalIPCArray['_call_type'] = -2;
            } else {
                $this->internalIPCArray['_call_type'] = -1;
            }
        } else {
            $this->internalIPCArray['_call_type'] = -1;
        }

        $this->internalIPCArray['_call_method'] = $methodName;
        $this->internalIPCArray['_call_input'] = $argList;

        $this->writeToIPCSegment();

        switch ($this->internalIPCArray['_call_type']) {
            case -1:
                $this->sendSigUsr1();
                break;

            case -2:
                shmop_write($this->internalSemaphoreKey, 1, 0);

                $this->sendSigUsr1();
                $this->waitIPCSemaphore();
                $this->readFromIPCSegment();

                shmop_write($this->internalSemaphoreKey, 0, 1);

                return $this->internalIPCArray['_call_output'];
        }

        return false;
    }
public function register_callback_func($argList, $methodName)
    {
        if (is_array($argList) && count($argList) > 1) {
            if ($argList[1] === -2) {
                $this->internalIPCArray['_call_type'] = -2;
            } else {
                $this->internalIPCArray['_call_type'] = -1;
            }
        } else {
            $this->internalIPCArray['_call_type'] = -1;
        }

        $this->internalIPCArray['_call_method'] = $methodName;
        $this->internalIPCArray['_call_input'] = $argList;

        $this->writeToIPCSegment();

        switch ($this->internalIPCArray['_call_type']) {
            case -1:
                $this->sendSigUsr1();
                break;

            case -2:
                shmop_write($this->internalSemaphoreKey, 1, 0);

                $this->sendSigUsr1();
                $this->waitIPCSemaphore();
                $this->readFromIPCSegment();

                shmop_write($this->internalSemaphoreKey, 0, 1);

                return $this->internalIPCArray['_call_output'];
        }

        return false;
    }
public function register_callback_func ( $ argList , $ methodName ) { if ( is_array ( $ argList ) && count ( $ argList ) > 1 ) { if ( $ argList [ 1 ] === - 2 ) { $ this -> internalIPCArray [ '_call_type' ] = - 2 ; } else { $ this -> internalIPCArray [ '_call_type' ] = - 1 ; } } else { $ this -> internalIPCArray [ '_call_type' ] = - 1 ; } $ this -> internalIPCArray [ '_call_method' ] = $ methodName ; $ this -> internalIPCArray [ '_call_input' ] = $ argList ; $ this -> writeToIPCSegment ( ) ; switch ( $ this -> internalIPCArray [ '_call_type' ] ) { case - 1 : $ this -> sendSigUsr1 ( ) ; break ; case - 2 : shmop_write ( $ this -> internalSemaphoreKey , 1 , 0 ) ; $ this -> sendSigUsr1 ( ) ; $ this -> waitIPCSemaphore ( ) ; $ this -> readFromIPCSegment ( ) ; shmop_write ( $ this -> internalSemaphoreKey , 0 , 1 ) ; return $ this -> internalIPCArray [ '_call_output' ] ; } return false ; }
Register callback func into shared memory

@access public

@param mixed $argList
@param string $methodName

@return mixed|void
@throws \Micro\Base\Exception
Register callback func into shared memory