Property | Type | Description | |
---|---|---|---|
$config | Related config section | ||
$enableRPC | Is RPC enabled? | ||
$passphrase | Optional passphrase | ||
$ready | Ready to run? | ||
$requestClass | Default class of incoming requests | ||
$runOnDemand | If true, it's allowed to be run without defined config section' |
Property | Type | Description | |
---|---|---|---|
$name | Instance name |
Method | Description | |
---|---|---|
RPCall ( string $method, array $args ) : mixed | Function handles incoming Remote Procedure Calls You can override it | |
__construct ( string $name = '' ) : void | Application constructor | |
beginRequest ( object $req, object $upstream ) : object | Create Request instance | |
broadcastCall ( string $method, array $args = [], callable $cb = null ) : boolean | Send broadcast RPC You can override it | |
directCall ( integer $workerId, string $method, array $args = [], mixed $cb = null ) : boolean | Send RPC, executed once in certain worker You can override it | |
getConfig ( ) : |
Returns a config section | |
getInstance ( string $name, boolean $spawn = true ) : |
||
getName ( ) : string | Returns the instance name | |
handleRequest ( object $parent, object $upstream ) : object | Handle the request | |
handleStatus ( integer $ret ) : boolean | Handle the worker status | |
isEnabled ( ) : boolean | Returns whether if this application is enabled | |
log ( string $message ) : void | Log something | |
onConfigUpdated ( ) : void | Called when worker is going to update configuration | |
onReady ( ) : void | Called when the worker is ready to go | |
singleCall ( string $method, array $args = [], mixed $cb = null ) : boolean | Send RPC, executed once in any worker You can override it |
Method | Description | |
---|---|---|
getConfigDefaults ( ) : boolean | Function to get default config options from application Override to set your own | |
init ( ) : void | Called when creates instance of the application | |
onShutdown ( $graceful = false ) : boolean | Called when application instance is going to shutdown |
public __construct ( string $name = '' ) : void | ||
$name | string | Instance name |
return | void |
public getConfig ( ) : |
||
return |
protected getConfigDefaults ( ) : boolean | ||
return | boolean |
public static getInstance ( string $name, boolean $spawn = true ) : |
||
$name | string | Instance name |
$spawn | boolean | If true, we spawn an instance if absent |
return |
public handleStatus ( integer $ret ) : boolean | ||
$ret | integer | Status code |
return | boolean | Result |
public onConfigUpdated ( ) : void | ||
return | void |
protected onShutdown ( $graceful = false ) : boolean | ||
return | boolean | Ready to shutdown? |