'Publish a message to an event queue.
Args:
event_name: The name of the event to publish to.
message: An RDFValue instance to publish to the event listeners.
session_id: The session id to send from, defaults to self.session_id.
priority: Controls the priority of this message.'

def Publish(self, event_name, message=None, session_id=None, priority=rdf_flows.GrrMessage.Priority.MEDIUM_PRIORITY):

    result = message
    logging.debug('Publishing    %s    to    %s', utils.SmartUnicode(message)[:100], event_name)
    if (not isinstance(message, rdf_flows.GrrMessage)):
        result = rdf_flows.GrrMessage(payload=message)
    result.session_id = (session_id or self.session_id)
    result.auth_state = rdf_flows.GrrMessage.AuthorizationState.AUTHENTICATED
    result.source = self.session_id
    result.priority = priority
    self.runner.Publish(event_name, result)
