def waitUntilAllDisconnected(reactor, protocols):
 lc = None
 def _check():
  if (not (True in [x.transport.connected for x in protocols])):
   lc.stop()
 lc = task.LoopingCall(_check)
 lc.clock = reactor
 return lc.start(0.01, now=True)

def waitUntilAllDisconnected ( reactor , protocols ) : lc = None def _check ( ) : if ( not ( True in [ x . transport . connected for x in protocols ] ) ) : lc . stop ( ) lc = task . LoopingCall ( _check ) lc . clock = reactor return lc . start ( 0.01 , now = True )
take a list of disconnecting protocols .