PHP 클래스 PHPDaemon\Request\Generic

상속: use trait PHPDaemon\Traits\ClassWatchdog, use trait PHPDaemon\Traits\StaticObjectWatchdog, use trait PHPDaemon\Traits\EventHandlers
파일 보기 프로젝트 열기: kakserpom/phpdaemon 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$appInstance PHPDaemon\Core\AppInstance Related Application instance
$attrs StdCLass Attributes

보호된 프로퍼티들

프로퍼티 타입 설명
$aborted boolean Is this request aborted?
$autoinit
$codepoint mixed Current code point
$ev object Event
$priority integer Priority
$running boolean Is this request running?
$shutdownFuncs array Registered shutdown functions
$sleepTime float Current sleep() time
$state State
$upstream object Upstream

공개 메소드들

메소드 설명
__construct ( AppInstance $appInstance, PHPDaemon\Request\IRequestUpstream $upstream, object $parent = null ) Constructor
__toString ( ) : string This magic method called when the object casts to string
abort ( ) : void Aborts the request
callInit ( )
checkIfReady ( ) : boolean Called to check if Request is ready
codepoint ( $p ) : boolean Helper for easy switching between several interruptable stages of request's execution
eventCall ( $arg ) : void Event handler of Request, called by Evtimer
finish ( $status, $zombie = false ) : void Finish the request
free ( ) : void Frees the request
getArray ( &$var, $filter = null ) : string Get array value from the given variable
getInteger ( &$var, $values = null ) : string Get integer value from the given variable
getMixed ( &$var ) : string Get string value from the given variable
getString ( &$var, $values = null ) : string Get string value from the given variable
handleException ( $e ) : boolean | null Uncaught exception handler
isAborted ( ) : boolean Is this request aborted?
isFinished ( ) : boolean Is this request finished?
isRunning ( ) : boolean Is this request running?
log ( string $msg ) : void Log
onAbort ( ) : void Called when the request aborted
onFinish ( ) : void Called when the request finished
onSleep ( ) : void Called when the request starts sleep
onWakeup ( ) : void Called when the request wakes up
onWrite ( ) : void Called when the connection is ready to accept new data
out ( string $s, boolean $flush = true ) : boolean | null Output some data
registerShutdownFunction ( callable $callback ) : void Adds new callback called before the request finished
setPriority ( $p ) : void Sets the priority
sleep ( integer $time, boolean $set = false ) : void Delays the request execution for the given number of seconds
terminate ( $s = null ) : void Throws terminating exception
unregisterShutdownFunction ( callable $callback ) : void Remove the given callback
wakeup ( ) : void Cancel current sleep

보호된 메소드들

메소드 설명
init ( ) : void Called when request constructs
postFinishHandler ( callable $cb = null ) : void Called after request finish
preinit ( $req ) : void Preparing before init
run ( ) : integer Called when request iterated.

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( AppInstance $appInstance, PHPDaemon\Request\IRequestUpstream $upstream, object $parent = null )
$appInstance PHPDaemon\Core\AppInstance Parent AppInstance.
$upstream PHPDaemon\Request\IRequestUpstream Upstream.
$parent object Source request.

__toString() 공개 메소드

This magic method called when the object casts to string
public __toString ( ) : string
리턴 string Description

abort() 공개 메소드

Aborts the request
public abort ( ) : void
리턴 void

callInit() 공개 메소드

public callInit ( )

checkIfReady() 공개 메소드

Called to check if Request is ready
public checkIfReady ( ) : boolean
리턴 boolean Ready?

codepoint() 공개 메소드

Helper for easy switching between several interruptable stages of request's execution
public codepoint ( $p ) : boolean
리턴 boolean Execute

eventCall() 공개 메소드

Event handler of Request, called by Evtimer
public eventCall ( $arg ) : void
$arg
리턴 void

finish() 공개 메소드

Finish the request
public finish ( $status, $zombie = false ) : void
리턴 void

free() 공개 메소드

Frees the request
public free ( ) : void
리턴 void

getArray() 공개 정적인 메소드

Get array value from the given variable
public static getArray ( &$var, $filter = null ) : string
리턴 string Value.

getInteger() 공개 정적인 메소드

Get integer value from the given variable
public static getInteger ( &$var, $values = null ) : string
리턴 string Value.

getMixed() 공개 정적인 메소드

Get string value from the given variable
public static getMixed ( &$var ) : string
리턴 string Value.

getString() 공개 정적인 메소드

Get string value from the given variable
public static getString ( &$var, $values = null ) : string
리턴 string Value.

handleException() 공개 메소드

Uncaught exception handler
public handleException ( $e ) : boolean | null
$e
리턴 boolean | null Handled?

init() 보호된 메소드

Called when request constructs
protected init ( ) : void
리턴 void

isAborted() 공개 메소드

Is this request aborted?
public isAborted ( ) : boolean
리턴 boolean

isFinished() 공개 메소드

Is this request finished?
public isFinished ( ) : boolean
리턴 boolean

isRunning() 공개 메소드

Is this request running?
public isRunning ( ) : boolean
리턴 boolean

log() 공개 메소드

Log
public log ( string $msg ) : void
$msg string Message
리턴 void

onAbort() 공개 메소드

Called when the request aborted
public onAbort ( ) : void
리턴 void

onFinish() 공개 메소드

Called when the request finished
public onFinish ( ) : void
리턴 void

onSleep() 공개 메소드

Called when the request starts sleep
public onSleep ( ) : void
리턴 void

onWakeup() 공개 메소드

Called when the request wakes up
public onWakeup ( ) : void
리턴 void

onWrite() 공개 메소드

Called when the connection is ready to accept new data
public onWrite ( ) : void
리턴 void

out() 공개 메소드

Output some data
public out ( string $s, boolean $flush = true ) : boolean | null
$s string String to out
$flush boolean
리턴 boolean | null Success

postFinishHandler() 보호된 메소드

Called after request finish
protected postFinishHandler ( callable $cb = null ) : void
$cb callable
리턴 void

preinit() 보호된 메소드

Preparing before init
protected preinit ( $req ) : void
리턴 void

registerShutdownFunction() 공개 메소드

Adds new callback called before the request finished
public registerShutdownFunction ( callable $callback ) : void
$callback callable
리턴 void

run() 보호된 메소드

Called when request iterated.
protected run ( ) : integer
리턴 integer Status.

setPriority() 공개 메소드

Sets the priority
public setPriority ( $p ) : void
리턴 void

sleep() 공개 메소드

Delays the request execution for the given number of seconds
public sleep ( integer $time, boolean $set = false ) : void
$time integer Time to sleep in seconds
$set boolean Set this parameter to true when use call it outside of Request->run() or if you don't want to interrupt execution now
리턴 void

terminate() 공개 메소드

Throws terminating exception
public terminate ( $s = null ) : void
$s
리턴 void

unregisterShutdownFunction() 공개 메소드

Remove the given callback
public unregisterShutdownFunction ( callable $callback ) : void
$callback callable
리턴 void

wakeup() 공개 메소드

Cancel current sleep
public wakeup ( ) : void
리턴 void

프로퍼티 상세

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

Is this request aborted?
protected bool $aborted
리턴 boolean

$appInstance 공개적으로 프로퍼티

Related Application instance
public AppInstance,PHPDaemon\Core $appInstance
리턴 PHPDaemon\Core\AppInstance

$attrs 공개적으로 프로퍼티

Attributes
public StdCLass $attrs
리턴 StdCLass

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

protected $autoinit

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

Current code point
protected mixed $codepoint
리턴 mixed

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

Event
protected object $ev
리턴 object

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

Priority
protected int $priority
리턴 integer

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

Is this request running?
protected bool $running
리턴 boolean

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

Registered shutdown functions
protected array $shutdownFuncs
리턴 array

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

Current sleep() time
protected float $sleepTime
리턴 float

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

State
protected $state

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

Upstream
protected object $upstream
리턴 object