Thruway\ClientSession::register PHP Method

register() public method

Register
public register ( string $procedureName, callable $callback, array | mixed $options = null ) : Promise
$procedureName string
$callback callable
$options array | mixed
return React\Promise\Promise
    public function register($procedureName, callable $callback, $options = null)
    {
        return $this->peer->getCallee()->register($this, $procedureName, $callback, $options);
    }

Usage Example

Example #1
0
 /**
  * @param \Thruway\ClientSession $session
  * @param \Thruway\Transport\TransportInterface $transport
  */
 public function onSessionStart($session, $transport)
 {
     // TODO: now that the session has started, setup the stuff
     echo "--------------- Hello from InternalClient ------------\n";
     $session->register('com.example.getphpversion', [$this, 'getPhpVersion']);
     $session->register('com.example.getonline', [$this, 'getOnline']);
     $session->subscribe('wamp.metaevent.session.on_join', [$this, 'onSessionJoin']);
     $session->subscribe('wamp.metaevent.session.on_leave', [$this, 'onSessionLeave']);
 }
All Usage Examples Of Thruway\ClientSession::register