Publish messages to subscribers.

    Args:
      message: The message to publish.
      client_filter: A filter function to call passing in each client. Only
                     clients for whom the function returns True will have the
                     message sent to them.

def publish(cls, message, client_filter=None):
    """Publish messages to subscribers.

    Args:
      message: The message to publish.
      client_filter: A filter function to call passing in each client. Only
                     clients for whom the function returns True will have the
                     message sent to them.
    """
    with cls._lock:
      for client in cls.subscribers:
        if (not client_filter) or client_filter(client):
          client.send(message)