@@ -53,9 +53,9 @@ private function client()
53
53
$ subscribed =& $ this ->subscribed ;
54
54
$ psubscribed =& $ this ->psubscribed ;
55
55
$ loop = $ this ->loop ;
56
- return $ pending = $ this ->factory ->createClient ($ this ->target )->then (function (Client $ client ) use ($ self , &$ pending , &$ idleTimer , &$ subscribed , &$ psubscribed , $ loop ) {
56
+ return $ pending = $ this ->factory ->createClient ($ this ->target )->then (function (Client $ redis ) use ($ self , &$ pending , &$ idleTimer , &$ subscribed , &$ psubscribed , $ loop ) {
57
57
// connection completed => remember only until closed
58
- $ client ->on ('close ' , function () use (&$ pending , $ self , &$ subscribed , &$ psubscribed , &$ idleTimer , $ loop ) {
58
+ $ redis ->on ('close ' , function () use (&$ pending , $ self , &$ subscribed , &$ psubscribed , &$ idleTimer , $ loop ) {
59
59
$ pending = null ;
60
60
61
61
// foward unsubscribe/punsubscribe events when underlying connection closes
@@ -77,21 +77,21 @@ private function client()
77
77
});
78
78
79
79
// keep track of all channels and patterns this connection is subscribed to
80
- $ client ->on ('subscribe ' , function ($ channel ) use (&$ subscribed ) {
80
+ $ redis ->on ('subscribe ' , function ($ channel ) use (&$ subscribed ) {
81
81
$ subscribed [$ channel ] = true ;
82
82
});
83
- $ client ->on ('psubscribe ' , function ($ pattern ) use (&$ psubscribed ) {
83
+ $ redis ->on ('psubscribe ' , function ($ pattern ) use (&$ psubscribed ) {
84
84
$ psubscribed [$ pattern ] = true ;
85
85
});
86
- $ client ->on ('unsubscribe ' , function ($ channel ) use (&$ subscribed ) {
86
+ $ redis ->on ('unsubscribe ' , function ($ channel ) use (&$ subscribed ) {
87
87
unset($ subscribed [$ channel ]);
88
88
});
89
- $ client ->on ('punsubscribe ' , function ($ pattern ) use (&$ psubscribed ) {
89
+ $ redis ->on ('punsubscribe ' , function ($ pattern ) use (&$ psubscribed ) {
90
90
unset($ psubscribed [$ pattern ]);
91
91
});
92
92
93
93
Util::forwardEvents (
94
- $ client ,
94
+ $ redis ,
95
95
$ self ,
96
96
array (
97
97
'message ' ,
@@ -103,7 +103,7 @@ private function client()
103
103
)
104
104
);
105
105
106
- return $ client ;
106
+ return $ redis ;
107
107
}, function (\Exception $ e ) use (&$ pending ) {
108
108
// connection failed => discard connection attempt
109
109
$ pending = null ;
@@ -122,9 +122,9 @@ public function __call($name, $args)
122
122
}
123
123
124
124
$ that = $ this ;
125
- return $ this ->client ()->then (function (Client $ client ) use ($ name , $ args , $ that ) {
125
+ return $ this ->client ()->then (function (Client $ redis ) use ($ name , $ args , $ that ) {
126
126
$ that ->awake ();
127
- return \call_user_func_array (array ($ client , $ name ), $ args )->then (
127
+ return \call_user_func_array (array ($ redis , $ name ), $ args )->then (
128
128
function ($ result ) use ($ that ) {
129
129
$ that ->idle ();
130
130
return $ result ;
@@ -148,11 +148,11 @@ public function end()
148
148
}
149
149
150
150
$ that = $ this ;
151
- return $ this ->client ()->then (function (Client $ client ) use ($ that ) {
152
- $ client ->on ('close ' , function () use ($ that ) {
151
+ return $ this ->client ()->then (function (Client $ redis ) use ($ that ) {
152
+ $ redis ->on ('close ' , function () use ($ that ) {
153
153
$ that ->close ();
154
154
});
155
- $ client ->end ();
155
+ $ redis ->end ();
156
156
});
157
157
}
158
158
@@ -166,8 +166,8 @@ public function close()
166
166
167
167
// either close active connection or cancel pending connection attempt
168
168
if ($ this ->promise !== null ) {
169
- $ this ->promise ->then (function (Client $ client ) {
170
- $ client ->close ();
169
+ $ this ->promise ->then (function (Client $ redis ) {
170
+ $ redis ->close ();
171
171
});
172
172
if ($ this ->promise !== null ) {
173
173
$ this ->promise ->cancel ();
@@ -208,8 +208,8 @@ public function idle()
208
208
$ idleTimer =& $ this ->idleTimer ;
209
209
$ promise =& $ this ->promise ;
210
210
$ idleTimer = $ this ->loop ->addTimer ($ this ->idlePeriod , function () use (&$ idleTimer , &$ promise ) {
211
- $ promise ->then (function (Client $ client ) {
212
- $ client ->close ();
211
+ $ promise ->then (function (Client $ redis ) {
212
+ $ redis ->close ();
213
213
});
214
214
$ promise = null ;
215
215
$ idleTimer = null ;
0 commit comments