File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 18
18
],
19
19
"require" : {
20
20
"php" : " ^7.2" ,
21
- "binsoul/net-mqtt" : " ^0.6 " ,
21
+ "binsoul/net-mqtt" : " ^0.7 " ,
22
22
"evenement/evenement" : " ^3" ,
23
23
"react/event-loop" : " ^1.1" ,
24
24
"react/promise" : " ^2.7" ,
Original file line number Diff line number Diff line change @@ -325,7 +325,17 @@ public function unsubscribe(Subscription $subscription): ExtendedPromiseInterfac
325
325
return new RejectedPromise (new LogicException ('The client is not connected. ' ));
326
326
}
327
327
328
- return $ this ->startFlow ($ this ->flowFactory ->buildOutgoingUnsubscribeFlow ([$ subscription ]));
328
+ $ deferred = new Deferred ();
329
+
330
+ $ this ->startFlow ($ this ->flowFactory ->buildOutgoingUnsubscribeFlow ([$ subscription ]))
331
+ ->then (static function (array $ subscriptions ) use ($ deferred ) {
332
+ $ deferred ->resolve (array_shift ($ subscriptions ));
333
+ })
334
+ ->otherwise (static function ($ exception ) use ($ deferred ) {
335
+ $ deferred ->reject ($ exception );
336
+ });
337
+
338
+ return $ deferred ->promise ();
329
339
}
330
340
331
341
/**
You can’t perform that action at this time.
0 commit comments