PHPDaemon\Examples\ExampleDNode::onReady PHP Method

onReady() public method

Called when the worker is ready to go.
public onReady ( ) : void
return void
    public function onReady()
    {
        $appInstance = $this;
        // a reference to this application instance for ExampleWebSocketRoute
        // URI /exampleApp should be handled by ExampleWebSocketRoute
        \PHPDaemon\Servers\WebSocket\Pool::getInstance()->addRoute('exampleDNode', function ($client) use($appInstance) {
            return new ExampleDNodeRoute($client, $appInstance);
        });
    }