PHP Trait PHPPM\ProcessCommunicationTrait

Show file Open project: php-pm/php-pm

Protected Properties

Property Type Description
$socketPath string Path to socket folder.

Public Methods

Method Description
processMessage ( array $data, Connection $conn ) Parses a received message. Redirects to the appropriate command* method.
setSocketPath ( string $socketPath )

Protected Methods

Method Description
bindProcessMessage ( Connection $conn ) Binds data-listener to $conn and waits for incoming commands.
getNewControllerHost ( boolean $removeOld = true ) : string
getNewSlaveSocket ( integer $port ) : string
getSockFile ( string $affix, boolean $removeOld ) : string
sendMessage ( Connection $conn, string $command, array $message = [] ) Sends a message through $conn.

Method Details

bindProcessMessage() protected method

Binds data-listener to $conn and waits for incoming commands.
protected bindProcessMessage ( Connection $conn )
$conn React\Socket\Connection

getNewControllerHost() protected method

protected getNewControllerHost ( boolean $removeOld = true ) : string
$removeOld boolean
return string

getNewSlaveSocket() protected method

protected getNewSlaveSocket ( integer $port ) : string
$port integer
return string

getSockFile() protected method

protected getSockFile ( string $affix, boolean $removeOld ) : string
$affix string
$removeOld boolean
return string

processMessage() public method

Parses a received message. Redirects to the appropriate command* method.
public processMessage ( array $data, Connection $conn )
$data array
$conn React\Socket\Connection

sendMessage() protected method

Sends a message through $conn.
protected sendMessage ( Connection $conn, string $command, array $message = [] )
$conn React\Socket\Connection
$command string
$message array

setSocketPath() public method

public setSocketPath ( string $socketPath )
$socketPath string

Property Details

$socketPath protected property

Path to socket folder.
protected string $socketPath
return string