PHP Class Gui\Ipc\Sender

This class is used to send communication messages
Since: 0.1
Author: Gabriel Couto @gabrielrcouto
Show file Open project: gabrielrcouto/php-gui Class Usage Examples

Public Properties

Property Type Description
$application gui\Application The application object
$lastId integer The latest id available
$receiver Receiver The receiver object

Protected Properties

Property Type Description
$sendLaterMessagesBuffer string The buffer of messages to be sent

Public Methods

Method Description
__construct ( Application $application, Receiver $receiver ) : void The constructor
send ( MessageInterface $message ) : void Send a message
tick ( ) : void Check and send queued messages
waitReturn ( MessageInterface $message ) : mixed Send a message and wait for the return

Protected Methods

Method Description
getLazarusJson ( MessageInterface $message ) : String Get a valid Lazarus RPC JSON String
out ( String $text ) : void Print debug information
processMessage ( MessageInterface $message ) : void Process a message before sending - Useful to incrementing IDs
writeOnStream ( ) : void Write on stdin stream

Method Details

__construct() public method

The constructor
public __construct ( Application $application, Receiver $receiver ) : void
$application gui\Application
$receiver Receiver
return void

getLazarusJson() protected method

Get a valid Lazarus RPC JSON String
protected getLazarusJson ( MessageInterface $message ) : String
$message MessageInterface Message to send
return String Lazarus JSON string

out() protected method

Print debug information
protected out ( String $text ) : void
$text String Text to print
return void

processMessage() protected method

Process a message before sending - Useful to incrementing IDs
protected processMessage ( MessageInterface $message ) : void
$message MessageInterface Message
return void

send() public method

Send a message
public send ( MessageInterface $message ) : void
$message MessageInterface Message to send
return void

tick() public method

Check and send queued messages
public tick ( ) : void
return void

waitReturn() public method

Send a message and wait for the return
public waitReturn ( MessageInterface $message ) : mixed
$message MessageInterface
return mixed The return of the message

writeOnStream() protected method

Write on stdin stream
protected writeOnStream ( ) : void
return void

Property Details

$application public property

The application object
public Application,Gui $application
return gui\Application

$lastId public property

The latest id available
public int $lastId
return integer

$receiver public property

The receiver object
public Receiver,Gui\Ipc $receiver
return Receiver

$sendLaterMessagesBuffer protected property

The buffer of messages to be sent
protected string $sendLaterMessagesBuffer
return string