Thruway\Peer\Router::registerModule PHP Method

registerModule() public method

Registers a RouterModule
public registerModule ( Thruway\Module\RouterModuleInterface $module )
$module Thruway\Module\RouterModuleInterface
    public function registerModule(RouterModuleInterface $module)
    {
        $module->initModule($this, $this->getLoop());
        $this->eventDispatcher->addSubscriber($module);
    }

Usage Example

示例#1
0
<?php

require "../bootstrap.php";
require 'SimpleAuthProviderClient.php';
use Thruway\Peer\Router;
use Thruway\Transport\RatchetTransportProvider;
$router = new Router();
$router->registerModule(new \Thruway\Authentication\AuthenticationManager());
//Provide authentication for the realm: 'somerealm'
$authProvClient = new SimpleAuthProviderClient(["somerealm"]);
$router->addInternalClient($authProvClient);
$router->registerModule(new RatchetTransportProvider("127.0.0.1", 9090));
$router->start();
All Usage Examples Of Thruway\Peer\Router::registerModule