@@ -77,6 +77,7 @@ public function __construct(Stream $stream, ParserInterface $parser = null, Seri
77
77
public function __call ($ name , $ args )
78
78
{
79
79
$ request = new Deferred ();
80
+ $ promise = $ request ->promise ();
80
81
81
82
$ name = strtolower ($ name );
82
83
@@ -94,15 +95,15 @@ public function __call($name, $args)
94
95
95
96
if ($ name === 'monitor ' ) {
96
97
$ monitoring =& $ this ->monitoring ;
97
- $ request ->then (function () use (&$ monitoring ) {
98
+ $ promise ->then (function () use (&$ monitoring ) {
98
99
$ monitoring = true ;
99
100
});
100
101
} elseif (in_array ($ name , $ pubsubs )) {
101
102
$ that = $ this ;
102
103
$ subscribed =& $ this ->subscribed ;
103
104
$ psubscribed =& $ this ->psubscribed ;
104
105
105
- $ request ->then (function ($ array ) use ($ that , &$ subscribed , &$ psubscribed ) {
106
+ $ promise ->then (function ($ array ) use ($ that , &$ subscribed , &$ psubscribed ) {
106
107
$ first = array_shift ($ array );
107
108
108
109
// (p)(un)subscribe messages are to be forwarded
@@ -117,7 +118,7 @@ public function __call($name, $args)
117
118
});
118
119
}
119
120
120
- return $ request -> promise () ;
121
+ return $ promise ;
121
122
}
122
123
123
124
public function handleMessage (ModelInterface $ message )
0 commit comments