PHP Class Thruway\ClientSession

Inheritance: extends AbstractSession
Exibir arquivo Open project: voryx/thruway Class Usage Examples

Public Methods

Method Description
__construct ( Thruway\Transport\TransportInterface $transport, Thruway\Peer\ClientInterface $peer ) Constructor
call ( string $procedureName, array | mixed $arguments = null, array | mixed $argumentsKw = null, array | mixed $options = null ) : Promise Call
close ( ) Close client session TODO: Need to send goodbye message
onClose ( ) Handle on close client session
publish ( string $topicName, array | mixed $arguments = null, array | mixed $argumentsKw = null, array | mixed $options = null ) : Promise Publish
register ( string $procedureName, callable $callback, array | mixed $options = null ) : Promise Register
sendMessage ( Thruway\Message\Message $msg ) : mixed | void
setSessionId ( integer $sessionId )
subscribe ( string $topicName, callable $callback, $options = null ) : Promise Subscribe
unregister ( string $procedureName ) : Promise | FALSE Unregister

Method Details

__construct() public method

Constructor
public __construct ( Thruway\Transport\TransportInterface $transport, Thruway\Peer\ClientInterface $peer )
$transport Thruway\Transport\TransportInterface
$peer Thruway\Peer\ClientInterface

call() public method

Call
public call ( string $procedureName, array | mixed $arguments = null, array | mixed $argumentsKw = null, array | mixed $options = null ) : Promise
$procedureName string
$arguments array | mixed
$argumentsKw array | mixed
$options array | mixed
return React\Promise\Promise

close() public method

Close client session TODO: Need to send goodbye message
public close ( )

onClose() public method

Handle on close client session
public onClose ( )

publish() public method

Publish
public publish ( string $topicName, array | mixed $arguments = null, array | mixed $argumentsKw = null, array | mixed $options = null ) : Promise
$topicName string
$arguments array | mixed
$argumentsKw array | mixed
$options array | mixed
return React\Promise\Promise

register() public method

Register
public register ( string $procedureName, callable $callback, array | mixed $options = null ) : Promise
$procedureName string
$callback callable
$options array | mixed
return React\Promise\Promise

sendMessage() public method

public sendMessage ( Thruway\Message\Message $msg ) : mixed | void
$msg Thruway\Message\Message
return mixed | void

setSessionId() public method

public setSessionId ( integer $sessionId )
$sessionId integer

subscribe() public method

Subscribe
public subscribe ( string $topicName, callable $callback, $options = null ) : Promise
$topicName string
$callback callable
$options array
return React\Promise\Promise

unregister() public method

Unregister
public unregister ( string $procedureName ) : Promise | FALSE
$procedureName string
return React\Promise\Promise | FALSE