PHP 클래스 PHPDaemon\Network\Pool

저자: Vasily Zorin ([email protected])
상속: extends PHPDaemon\Structures\ObjectStorage, use trait PHPDaemon\Traits\EventLoopContainer
파일 보기 프로젝트 열기: kakserpom/phpdaemon 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$appInstance Application instance object
$config Configuration
$connectionClass Default connection class
$maxAllowedPacket Max allowed packet
$maxConcurrency Max concurrency
$name Name

보호된 프로퍼티들

프로퍼티 타입 설명
$enabled Is enabled?
$finished Is finished?
$instances Instances storage
$overload Is overloaded?

공개 메소드들

메소드 설명
__construct ( array $config = [], boolean $init = true ) Constructor
attach ( object $conn, mixed $inf = null ) : void Attach Connection
connect ( string $url, callback $cb, string $class = null ) : integer Establish a connection with remote peer
detach ( object $conn ) : void Detach Connection
disable ( ) : void Disable all events of sockets
enable ( ) : void Enable socket events
finish ( $graceful = false ) : boolean Finishes ConnectionPool
getInstance ( string $arg = '', boolean $spawn = true ) : this Returns instance object
onConfigUpdated ( ) : void Called when worker is going to update configuration
onReady ( ) : void Called when the worker is ready to go
onShutdown ( boolean $graceful = false ) : boolean Called when application instance is going to shutdown
setConnectionClass ( string $class ) : void Sets default connection class

보호된 메소드들

메소드 설명
applyConfig ( ) : void Applies config
getConfigDefaults ( ) : boolean Setting default config options
init ( ) : void Init
onDisable ( ) : void Called when ConnectionPool is now disabled
onEnable ( ) : void Called when ConnectionPool is now enabled
onFinish ( ) : void Called when ConnectionPool is finished

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( array $config = [], boolean $init = true )
$config array Config variables
$init boolean

applyConfig() 보호된 메소드

Applies config
protected applyConfig ( ) : void
리턴 void

attach() 공개 메소드

Attach Connection
public attach ( object $conn, mixed $inf = null ) : void
$conn object Connection
$inf mixed Info
리턴 void

connect() 공개 메소드

Establish a connection with remote peer
public connect ( string $url, callback $cb, string $class = null ) : integer
$url string URL
$cb callback Callback
$class string Optional. Connection class name
리턴 integer Connection's ID. Boolean false when failed

detach() 공개 메소드

Detach Connection
public detach ( object $conn ) : void
$conn object Connection
리턴 void

disable() 공개 메소드

Disable all events of sockets
public disable ( ) : void
리턴 void

enable() 공개 메소드

Enable socket events
public enable ( ) : void
리턴 void

finish() 공개 메소드

Finishes ConnectionPool
public finish ( $graceful = false ) : boolean
리턴 boolean Success

getConfigDefaults() 보호된 메소드

Setting default config options
protected getConfigDefaults ( ) : boolean
리턴 boolean

getInstance() 공개 정적인 메소드

Returns instance object
public static getInstance ( string $arg = '', boolean $spawn = true ) : this
$arg string name / array config / ConfigSection
$spawn boolean Spawn? Default is true
리턴 this

init() 보호된 메소드

Init
protected init ( ) : void
리턴 void

onConfigUpdated() 공개 메소드

Called when worker is going to update configuration
public onConfigUpdated ( ) : void
리턴 void

onDisable() 보호된 메소드

Called when ConnectionPool is now disabled
protected onDisable ( ) : void
리턴 void

onEnable() 보호된 메소드

Called when ConnectionPool is now enabled
protected onEnable ( ) : void
리턴 void

onFinish() 보호된 메소드

Called when ConnectionPool is finished
protected onFinish ( ) : void
리턴 void

onReady() 공개 메소드

Called when the worker is ready to go
public onReady ( ) : void
리턴 void

onShutdown() 공개 메소드

Called when application instance is going to shutdown
public onShutdown ( boolean $graceful = false ) : boolean
$graceful boolean
리턴 boolean Ready to shutdown?

setConnectionClass() 공개 메소드

Sets default connection class
public setConnectionClass ( string $class ) : void
$class string Connection class name
리턴 void

프로퍼티 상세

$appInstance 공개적으로 프로퍼티

Application instance object
public $appInstance

$config 공개적으로 프로퍼티

Configuration
public $config

$connectionClass 공개적으로 프로퍼티

Default connection class
public $connectionClass

$enabled 보호되어 있는 프로퍼티

Is enabled?
protected $enabled

$finished 보호되어 있는 프로퍼티

Is finished?
protected $finished

$instances 보호되어 있는 정적으로 프로퍼티

Instances storage
protected static $instances

$maxAllowedPacket 공개적으로 프로퍼티

Max allowed packet
public $maxAllowedPacket

$maxConcurrency 공개적으로 프로퍼티

Max concurrency
public $maxConcurrency

$name 공개적으로 프로퍼티

Name
public $name

$overload 보호되어 있는 프로퍼티

Is overloaded?
protected $overload