@@ -51,7 +51,7 @@ public function __construct(WampContext $context)
51
51
* {@inheritdoc}
52
52
*
53
53
* @param WampDestination $destination
54
- * @param WampMessage $message
54
+ * @param WampMessage $message
55
55
*/
56
56
public function send (Destination $ destination , Message $ message ): void
57
57
{
@@ -86,7 +86,6 @@ public function send(Destination $destination, Message $message): void
86
86
});
87
87
88
88
$ this ->client ->on ('do-send ' , function (WampDestination $ destination , WampMessage $ message ) {
89
-
90
89
$ onFinish = function () {
91
90
$ this ->client ->emit ('do-stop ' );
92
91
};
@@ -113,25 +112,6 @@ public function send(Destination $destination, Message $message): void
113
112
$ this ->client ->getLoop ()->run ();
114
113
}
115
114
116
- private function doSendMessageIfPossible ()
117
- {
118
- if (null === $ this ->session ) {
119
- return ;
120
- }
121
-
122
- if (null === $ this ->message ) {
123
- return ;
124
- }
125
-
126
- $ message = $ this ->message ;
127
- $ destination = $ this ->destination ;
128
-
129
- $ this ->message = null ;
130
- $ this ->destination = null ;
131
-
132
- $ this ->client ->emit ('do-send ' , [$ destination , $ message ]);
133
- }
134
-
135
115
/**
136
116
* {@inheritdoc}
137
117
*
@@ -188,4 +168,23 @@ public function getTimeToLive(): ?int
188
168
{
189
169
return null ;
190
170
}
171
+
172
+ private function doSendMessageIfPossible ()
173
+ {
174
+ if (null === $ this ->session ) {
175
+ return ;
176
+ }
177
+
178
+ if (null === $ this ->message ) {
179
+ return ;
180
+ }
181
+
182
+ $ message = $ this ->message ;
183
+ $ destination = $ this ->destination ;
184
+
185
+ $ this ->message = null ;
186
+ $ this ->destination = null ;
187
+
188
+ $ this ->client ->emit ('do-send ' , [$ destination , $ message ]);
189
+ }
191
190
}
0 commit comments