code: def terminate():
      
      with _sender_instances_lock:
          for sender_key, sender in _sender_instances.items():
              sender.close()
          _sender_instances.clear()
docs: Stops all the active Senders by flushing the buffers and closing the
      underlying sockets