PHP Class PHPDaemon\Core\AppResolver

Author: Vasily Zorin ([email protected])
Inheritance: use trait PHPDaemon\Traits\ClassWatchdog, use trait PHPDaemon\Traits\StaticObjectWatchdog
Datei anzeigen Open project: kakserpom/phpdaemon

Public Methods

Method Description
getAppFullName ( string $appName, string $instance = '' ) : string Resolve full name of application by its class and name
getInstance ( string $appName, string $instance = '', boolean $spawn = true, boolean $preload = false ) : object Gets instance of application
getInstanceByAppName ( string $appName, string $instance = '', boolean $spawn = true, boolean $preload = false ) : object Gets instance of application
getRequest ( object $req, object $upstream, string $responder = null ) : object Routes incoming request to related application
getRequestRoute ( object $req, object $upstream ) : string Routes incoming request to related application. Method is for overloading
preload ( boolean $privileged = false ) : void Preloads applications

Method Details

getAppFullName() public method

Resolve full name of application by its class and name
public getAppFullName ( string $appName, string $instance = '' ) : string
$appName string Application name
$instance string Application class
return string

getInstance() public method

Gets instance of application
public getInstance ( string $appName, string $instance = '', boolean $spawn = true, boolean $preload = false ) : object
$appName string Application name
$instance string Instance name
$spawn boolean If true, we spawn an instance if absent
$preload boolean If true, worker is at the preload stage
return object $instance AppInstance

getInstanceByAppName() public method

Gets instance of application
public getInstanceByAppName ( string $appName, string $instance = '', boolean $spawn = true, boolean $preload = false ) : object
$appName string Application name
$instance string Instance name
$spawn boolean If true, we spawn an instance if absent
$preload boolean If true, worker is at the preload stage
return object AppInstance

getRequest() public method

Routes incoming request to related application
public getRequest ( object $req, object $upstream, string $responder = null ) : object
$req object Generic
$upstream object AppInstance of Upstream
$responder string
return object Request

getRequestRoute() public method

Routes incoming request to related application. Method is for overloading
public getRequestRoute ( object $req, object $upstream ) : string
$req object Generic
$upstream object AppInstance of Upstream
return string Application's name

preload() public method

Preloads applications
public preload ( boolean $privileged = false ) : void
$privileged boolean If true, we are in the pre-fork stage
return void