1 | <?php |
||
16 | class ClientSession implements ClientSessionInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var ThruwaySession |
||
20 | */ |
||
21 | protected $thruwaySession; |
||
22 | |||
23 | public function __construct(ThruwaySession $thruwaySession) |
||
24 | { |
||
25 | $this->thruwaySession = $thruwaySession; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Subscribe. |
||
30 | * |
||
31 | * @param string $topicName |
||
32 | * @param callable $callback |
||
33 | * @param $options array |
||
34 | * |
||
35 | * @return \React\Promise\Promise |
||
36 | */ |
||
37 | public function subscribe($topicName, callable $callback, $options = null) |
||
38 | { |
||
39 | return $this->thruwaySession->subscribe($topicName, $callback, $options); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * Publish. |
||
44 | * |
||
45 | * @param string $topicName |
||
46 | * @param array|mixed $arguments |
||
47 | * @param array|mixed $argumentsKw |
||
48 | * @param array|mixed $options |
||
49 | * |
||
50 | * @return \React\Promise\Promise |
||
51 | */ |
||
52 | public function publish($topicName, $arguments = null, $argumentsKw = null, $options = null) |
||
56 | |||
57 | /** |
||
58 | * Register. |
||
59 | * |
||
60 | * @param string $procedureName |
||
61 | * @param callable $callback |
||
62 | * @param array|mixed $options |
||
63 | * |
||
64 | * @return \React\Promise\Promise |
||
65 | */ |
||
66 | public function register($procedureName, callable $callback, $options = null) |
||
70 | |||
71 | /** |
||
72 | * Unregister. |
||
73 | * |
||
74 | * @param string $procedureName |
||
75 | * |
||
76 | * @return \React\Promise\Promise |
||
77 | */ |
||
78 | public function unregister($procedureName) |
||
82 | |||
83 | /** |
||
84 | * Call. |
||
85 | * |
||
86 | * @param string $procedureName |
||
87 | * @param array|mixed $arguments |
||
88 | * @param array|mixed $argumentsKw |
||
89 | * @param array|mixed $options |
||
90 | * |
||
91 | * @return \React\Promise\Promise |
||
92 | */ |
||
93 | public function call($procedureName, $arguments = null, $argumentsKw = null, $options = null) |
||
97 | |||
98 | /** |
||
99 | * @param int $sessionId |
||
100 | */ |
||
101 | public function setSessionId($sessionId) |
||
105 | |||
106 | /** |
||
107 | * @return int the Session Id |
||
108 | */ |
||
109 | public function getSessionId() |
||
113 | |||
114 | public function sendMessage($msg) |
||
118 | } |
||
119 |