PHP Class PHPDaemon\SockJS\Application

Author: Vasily Zorin ([email protected])
Inheritance: extends PHPDaemon\Core\AppInstance
Datei anzeigen Open project: kakserpom/phpdaemon

Public Properties

Property Type Description
$wss

Protected Properties

Property Type Description
$redis
$sessions

Public Methods

Method Description
attachWss ( Pool $wss ) : boolean attachWss
beginRequest ( object $req, object $upstream ) : object Creates Request.
beginSession ( string $path, string $sessId, string $server ) : object beginSession
callMethod ( string $method, object $req, object $upstream ) : object callMethod
detachWss ( object $wss ) : boolean detachWss
endSession ( Session $session ) : void endSession
expire ( string $key, integer $seconds, callable $cb = null ) : void expire
getLocalSubscribersCount ( string $chan ) : integer getLocalSubscribersCount
getRouteOptions ( string $path ) : array getRouteOptions
getkey ( string $key, callable $cb = null ) : void getkey
onFinish ( ) : void onFinish
onReady ( ) : void Called when the worker is ready to go
publish ( string $chan, callable $cb, callable $opcb = null ) : void publish
setRedis ( Pool $redis ) Set Redis instance
setkey ( string $key, mixed $value, callable $cb = null ) : void setkey
setnx ( string $key, mixed $value, callable $cb = null ) : void setnx
subscribe ( string $chan, callable $cb, callable $opcb = null ) : void subscribe
unsubscribe ( string $chan, callable $cb, callable $opcb = null ) : void unsubscribe
unsubscribeReal ( string $chan, callable $opcb = null ) : void unsubscribeReal
wsHandler ( object $ws, string $path, object $client, callable $state ) : boolean wsHandler

Protected Methods

Method Description
getConfigDefaults ( ) : array | boolean Setting default config options

Method Details

attachWss() public method

attachWss
public attachWss ( Pool $wss ) : boolean
$wss PHPDaemon\Network\Pool
return boolean

beginRequest() public method

Creates Request.
public beginRequest ( object $req, object $upstream ) : object
$req object Request.
$upstream object Upstream application instance.
return object Request.

beginSession() public method

beginSession
public beginSession ( string $path, string $sessId, string $server ) : object
$path string [@todo description]
$sessId string [@todo description]
$server string [@todo description]
return object

callMethod() public method

callMethod
public callMethod ( string $method, object $req, object $upstream ) : object
$method string [@todo description]
$req object [@todo description]
$upstream object [@todo description]
return object

detachWss() public method

detachWss
public detachWss ( object $wss ) : boolean
$wss object [@todo description]
return boolean

endSession() public method

endSession
public endSession ( Session $session ) : void
$session Session
return void

expire() public method

expire
public expire ( string $key, integer $seconds, callable $cb = null ) : void
$key string [@todo description]
$seconds integer [@todo description]
$cb callable [@todo description]
return void

getConfigDefaults() protected method

Setting default config options
protected getConfigDefaults ( ) : array | boolean
return array | boolean

getLocalSubscribersCount() public method

getLocalSubscribersCount
public getLocalSubscribersCount ( string $chan ) : integer
$chan string
return integer

getRouteOptions() public method

getRouteOptions
public getRouteOptions ( string $path ) : array
$path string [@todo description]
return array

getkey() public method

getkey
public getkey ( string $key, callable $cb = null ) : void
$key string [@todo description]
$cb callable [@todo description]
return void

onFinish() public method

onFinish
public onFinish ( ) : void
return void

onReady() public method

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

publish() public method

publish
public publish ( string $chan, callable $cb, callable $opcb = null ) : void
$chan string [@todo description]
$cb callable [@todo description]
$opcb callable [@todo description]
return void

setRedis() public method

Set Redis instance
public setRedis ( Pool $redis )
$redis PHPDaemon\Clients\Redis\Pool

setkey() public method

setkey
public setkey ( string $key, mixed $value, callable $cb = null ) : void
$key string [@todo description]
$value mixed [@todo description]
$cb callable [@todo description]
return void

setnx() public method

setnx
public setnx ( string $key, mixed $value, callable $cb = null ) : void
$key string [@todo description]
$value mixed [@todo description]
$cb callable [@todo description]
return void

subscribe() public method

subscribe
public subscribe ( string $chan, callable $cb, callable $opcb = null ) : void
$chan string [@todo description]
$cb callable [@todo description]
$opcb callable [@todo description]
return void

unsubscribe() public method

unsubscribe
public unsubscribe ( string $chan, callable $cb, callable $opcb = null ) : void
$chan string [@todo description]
$cb callable [@todo description]
$opcb callable [@todo description]
return void

unsubscribeReal() public method

unsubscribeReal
public unsubscribeReal ( string $chan, callable $opcb = null ) : void
$chan string [@todo description]
$opcb callable [@todo description]
return void

wsHandler() public method

wsHandler
public wsHandler ( object $ws, string $path, object $client, callable $state ) : boolean
$ws object [@todo description]
$path string [@todo description]
$client object [@todo description]
$state callable [@todo description]
return boolean

Property Details

$redis protected_oe property

protected $redis

$sessions protected_oe property

protected $sessions

$wss public_oe property

public $wss