PHP Class Kraken\Loop\Model\SelectLoop

Inheritance: implements Kraken\Loop\LoopModelInterface
Datei anzeigen Open project: kraken-php/framework

Protected Properties

Property Type Description
$flowController Kraken\Loop\Flow\FlowController
$futureTickQueue Kraken\Loop\Tick\TickFiniteQueue
$nextTickQueue Kraken\Loop\Tick\TickContinousQueue
$readListeners callable[]
$readStreams resource[]
$startTickQueue Kraken\Loop\Tick\TickContinousQueue
$stopTickQueue Kraken\Loop\Tick\TickContinousQueue
$timers Kraken\Loop\Timer\TimerBox
$writeListeners callable[]
$writeStreams resource[]

Public Methods

Method Description
__construct ( )
__destruct ( )
addPeriodicTimer ( $interval, callable $callback )
addReadStream ( $stream, callable $listener )
addTimer ( $interval, callable $callback )
addWriteStream ( $stream, callable $listener )
cancelTimer ( Kraken\Loop\Timer\TimerInterface $timer )
erase ( $all = false )
export ( Kraken\Loop\LoopModelInterface $loop, $all = false )
getFlowController ( )
import ( Kraken\Loop\LoopModelInterface $loop, $all = false )
isRunning ( )
isTimerActive ( Kraken\Loop\Timer\TimerInterface $timer )
onAfterTick ( callable $listener )
onBeforeTick ( callable $listener )
onStart ( callable $listener )
onStop ( callable $listener )
removeReadStream ( $stream )
removeStream ( $stream )
removeWriteStream ( $stream )
setFlowController ( $flowController )
start ( )
stop ( )
swap ( Kraken\Loop\LoopModelInterface $loop, $all = false )
tick ( )

Private Methods

Method Description
getTransferableProperties ( ) : array Get list of properties that can be exported/imported safely.
streamSelect ( array &$read, array &$write, integer | null $timeout ) : integer Emulate a stream_select() implementation that does not break when passed empty stream arrays.
waitForStreamActivity ( float $timeout ) Wait/check for stream activity, or until the next timer is due.

Method Details

__construct() public method

public __construct ( )

__destruct() public method

public __destruct ( )

addPeriodicTimer() public method

public addPeriodicTimer ( $interval, callable $callback )
$callback callable

addReadStream() public method

public addReadStream ( $stream, callable $listener )
$listener callable

addTimer() public method

public addTimer ( $interval, callable $callback )
$callback callable

addWriteStream() public method

public addWriteStream ( $stream, callable $listener )
$listener callable

cancelTimer() public method

public cancelTimer ( Kraken\Loop\Timer\TimerInterface $timer )
$timer Kraken\Loop\Timer\TimerInterface

erase() public method

public erase ( $all = false )

export() public method

public export ( Kraken\Loop\LoopModelInterface $loop, $all = false )
$loop Kraken\Loop\LoopModelInterface

getFlowController() public method

public getFlowController ( )

import() public method

public import ( Kraken\Loop\LoopModelInterface $loop, $all = false )
$loop Kraken\Loop\LoopModelInterface

isRunning() public method

public isRunning ( )

isTimerActive() public method

public isTimerActive ( Kraken\Loop\Timer\TimerInterface $timer )
$timer Kraken\Loop\Timer\TimerInterface

onAfterTick() public method

public onAfterTick ( callable $listener )
$listener callable

onBeforeTick() public method

public onBeforeTick ( callable $listener )
$listener callable

onStart() public method

public onStart ( callable $listener )
$listener callable

onStop() public method

public onStop ( callable $listener )
$listener callable

removeReadStream() public method

public removeReadStream ( $stream )

removeStream() public method

public removeStream ( $stream )

removeWriteStream() public method

public removeWriteStream ( $stream )

setFlowController() public method

public setFlowController ( $flowController )

start() public method

public start ( )

stop() public method

public stop ( )

swap() public method

public swap ( Kraken\Loop\LoopModelInterface $loop, $all = false )
$loop Kraken\Loop\LoopModelInterface

tick() public method

public tick ( )

Property Details

$flowController protected_oe property

protected FlowController,Kraken\Loop\Flow $flowController
return Kraken\Loop\Flow\FlowController

$futureTickQueue protected_oe property

protected TickFiniteQueue,Kraken\Loop\Tick $futureTickQueue
return Kraken\Loop\Tick\TickFiniteQueue

$nextTickQueue protected_oe property

protected TickContinousQueue,Kraken\Loop\Tick $nextTickQueue
return Kraken\Loop\Tick\TickContinousQueue

$readListeners protected_oe property

protected callable[] $readListeners
return callable[]

$readStreams protected_oe property

protected resource[] $readStreams
return resource[]

$startTickQueue protected_oe property

protected TickContinousQueue,Kraken\Loop\Tick $startTickQueue
return Kraken\Loop\Tick\TickContinousQueue

$stopTickQueue protected_oe property

protected TickContinousQueue,Kraken\Loop\Tick $stopTickQueue
return Kraken\Loop\Tick\TickContinousQueue

$timers protected_oe property

protected TimerBox,Kraken\Loop\Timer $timers
return Kraken\Loop\Timer\TimerBox

$writeListeners protected_oe property

protected callable[] $writeListeners
return callable[]

$writeStreams protected_oe property

protected resource[] $writeStreams
return resource[]