File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ def finalize(self, reason=""):
190190 for handler in self ._on_disconnect_handlers :
191191 gevent .spawn (handler )
192192
193- def disconnect (self ):
193+ def disconnect (self , reason = "Disconnection requested." ):
194194 """Gracefully close the connection.
195195
196196 return (bool): True if the service was connected.
@@ -206,7 +206,7 @@ def disconnect(self):
206206 logger .warning ("Couldn't disconnect from %s: %s." ,
207207 self ._repr_remote (), error )
208208 finally :
209- self .finalize ("Disconnection requested." )
209+ self .finalize (reason = reason )
210210 return True
211211
212212 def _read (self ):
@@ -502,9 +502,9 @@ def connect(self):
502502 raise RuntimeError ("Already (auto-re)connecting" )
503503 self ._loop = gevent .spawn (self ._run )
504504
505- def disconnect (self ):
505+ def disconnect (self , reason = "Disconnection requested." ):
506506 """See RemoteServiceBase.disconnect."""
507- if super (RemoteServiceClient , self ).disconnect ():
507+ if super (RemoteServiceClient , self ).disconnect (reason = reason ):
508508 self ._loop .kill ()
509509 self ._loop = None
510510
You can’t perform that action at this time.
0 commit comments