code: def on_shutdown(self):
          
          LOG.debug('%r.on_shutdown()', self)
          for stream, state in self._state_by_stream.items():
              state.lock.acquire()
              try:
                  for sender, fp in reversed(state.jobs):
                      sender.close()
                      fp.close()
                      state.jobs.pop()
              finally:
                  state.lock.release()
docs: Respond to shutdown by sending close() to every target, allowing their
          receive loop to exit and clean up gracefully.