def METHOD_NAME(self, message, max_timeout=1000):
    """This function needs to be fast at the same time aware of the possibility of
    ZMQ pipes overflowing.
    The timeout increases slowly if contention is detected on ZMQ pipes.
    We could set copy=False and get slightly better latency but this results
    in ZMQ sockets reaching a broken state once there are ~10k tasks in flight.
    This issue can be magnified if each the serialized buffer itself is larger.
    Parameters
    ----------
    message : py object
         Python object to send
    max_timeout : int
         Max timeout in milliseconds that we will wait for before raising an
         exception
    Raises
    ------
    zmq.EAGAIN if the send failed.
    """
    timeout_ms = 0
    current_wait = 0
    while current_wait < max_timeout:
        socks = dict(self.poller.poll(timeout=timeout_ms))
        if self.zmq_socket in socks and socks[self.zmq_socket] == zmq.POLLOUT:
            # The copy option adds latency but reduces the risk of ZMQ overflow
            self.zmq_socket.send(message, copy=True)
            return
        else:
            timeout_ms += 1
            log.debug(
                "Not sending due to full zmq pipe, timeout: {} ms".format(
                    timeout_ms
                )
            )
        current_wait += timeout_ms
    # Send has failed.
    log.debug(f"Remote side has been unresponsive for {current_wait}")
    raise zmq.error.Again