code: def shutdown_all(self):
          
          self._lock.acquire()
          try:
              for context in list(self._key_by_context):
                  self._shutdown_unlocked(context)
          finally:
              self._lock.release()
docs: For testing use, arrange for all connections to be shut down.