Satori RTM Connection.
Access the RTM Service on the connection level to connect to the RTM Service, send and receive PDUs Uses WebSocket client to connect to RTM.
Does not handle any possible exceptions from the WS client.
package |
Default |
---|
__construct(string $endpoint, array $options = array())
Throws |
|
---|
string
array
Connection instance options
$options = [
'logger' => (\Psr\Log\LoggerInterface Custom logger
]
close(integer $status = 1000, string $reason = 'Connection closed') : true
integer
Close status code
string
Any message that will be send in close frame. All unprocessed callbacks will get this reason.
true
if websocket connection has been closed
closeCallbacks(string $reason) : void
Sends "disconnected" error to all callbacks that await for the response from Satori RTM.
string
Disconnect reason
connect() : true
Throws |
|
---|
true
isReusedPersistentConnection() : boolean
boolean
true if the connection is persistent and was reused. false otherwise
nextId() : integer
integer
Next id
read(integer $mode, integer $timeout_sec, integer $timeout_microsec) : array
Throws |
|
---|
integer
\Rtm\WebSocket\Client::SYNC_READ or \Rtm\WebSocket\Client::ASYNC_READ
integer
The seconds part of the timeout to be set
integer
The microseconds part of the timeout to be set
array
Combined \Rtm\WebSocket\ReturnCode and Rtm\Pdu\Pdu
send(string $action, array $body, callable $callback = null) : \RtmClient\always
Throws |
|
---|
string
PDU action
array
PDU body
callable
callback to be called when getting back request confirmation from RTM
\RtmClient\always
true
sendPing(string $text = 'ping') : true
string
Text to be send as ping payload
true
if sent
waitAllReplies(integer $timeout_sec, integer $timeout_microsec) : void
Throws |
|
---|
integer
The seconds part of the maximal awaiting time to be set
integer
The microseconds part of the maximal awaiting time to be set
endpoint : string
var |
---|
string
last_id : integer
var |
---|
integer
ws : \Rtm\WebSocket\Client
var |
---|
\Rtm\WebSocket\Client
callbacks : array
var |
---|
array