def dispatch(self, trigger, payload=None, trace_context=None):
        """
        Method which dispatches the trigger.

        :param trigger: Full name / reference of the trigger.
        :type trigger: ``str`` or ``object``

        :param payload: Trigger payload.
        :type payload: ``dict``

        :param trace_context: Trace context to associate with Trigger.
        :type trace_context: ``TraceContext``
        """
        if payload and not isinstance(payload, dict):
            raise TypeError(
                f"The payload has a value that is not a dictionary"
                f" (was {type(payload)})."
            )
        if trace_context and not isinstance(trace_context, TraceContext):
            raise TypeError(
                f"The trace context has a value that is not of type TraceContext"
                f" (was {type(trace_context)})."
            )

        payload = {"trigger": trigger, "payload": payload, TRACE_CONTEXT: trace_context}
        routing_key = "trigger_instance"

        self._logger.debug(
            "Dispatching trigger (trigger=%s,payload=%s)", trigger, payload
        )
        self._publisher.publish_trigger(payload=payload, routing_key=routing_key)

        Method which dispatches the trigger.

        :param trigger: Full name / reference of the trigger.
        :type trigger: ``str`` or ``object``

        :param payload: Trigger payload.
        :type payload: ``dict``

        :param trace_context: Trace context to associate with Trigger.
        :type trace_context: ``TraceContext``
        
st2common/st2common/transport/reactor.py