django_events_sourcing/senders/kombu.py
def dispatch(
        service_name, event_name, payload, amqp_uri, ssl=None,
        transport_options=None, heartbeat=60,
):
    """
    Dispatches an event. It mimics Nameko's and Micro-Framework's format of
    receiving events.

    :param event_name: Name of the Event
    :param payload: Serializable Payload to be sent
    :param amqp_uri: URI to connect to AMQP
    :param service_name: Name of the Service sending the event
    :param ssl: To use SSL or not
    :param transport_options: Transport Options dict
    :param heartbeat: AMQP Heartbeats interval
    """
    try:
        exchange = get_exchange(service_name)

        transport_options = transport_options or default_transport_options
        with producers[
            Connection(
                amqp_uri, ssl=ssl, transport_options=transport_options,
            )
        ].acquire(block=True) as producer:
            producer.publish(
                payload, routing_key=event_name, exchange=exchange,
                retry=True
            )

    except amqp.exceptions.NotFound:
        pass

    Dispatches an event. It mimics Nameko's and Micro-Framework's format of
    receiving events.

    :param event_name: Name of the Event
    :param payload: Serializable Payload to be sent
    :param amqp_uri: URI to connect to AMQP
    :param service_name: Name of the Service sending the event
    :param ssl: To use SSL or not
    :param transport_options: Transport Options dict
    :param heartbeat: AMQP Heartbeats interval
    
Dispatches an event. It mimics Nameko's and Micro-Framework's format of
receiving events.
Dispatches an event . It mimics Nameko ' s and Micro - Framework ' s format of receiving events .
def dispatch(
        service_name, event_name, payload, amqp_uri, ssl=None,
        transport_options=None, heartbeat=60,
):
    try:
        exchange = get_exchange(service_name)
        transport_options = transport_options or default_transport_options
        with producers[
            Connection(
                amqp_uri, ssl=ssl, transport_options=transport_options,
            )
        ].acquire(block=True) as producer:
            producer.publish(
                payload, routing_key=event_name, exchange=exchange,
                retry=True
            )
    except amqp.exceptions.NotFound:
        pass
def dispatch ( service_name , event_name , payload , amqp_uri , ssl = None , transport_options = None , heartbeat = 60 , ) : try : exchange = get_exchange ( service_name ) transport_options = transport_options or default_transport_options with producers [ Connection ( amqp_uri , ssl = ssl , transport_options = transport_options , ) ] . acquire ( block = True ) as producer : producer . publish ( payload , routing_key = event_name , exchange = exchange , retry = True ) except amqp . exceptions . NotFound : pass
Dispatches an event.
Dispatches an event .
"""
    Dispatches an event. It mimics Nameko's and Micro-Framework's format of
    receiving events.

    :param event_name: Name of the Event
    :param payload: Serializable Payload to be sent
    :param amqp_uri: URI to connect to AMQP
    :param service_name: Name of the Service sending the event
    :param ssl: To use SSL or not
    :param transport_options: Transport Options dict
    :param heartbeat: AMQP Heartbeats interval
    """
service_name
Name of the Service sending the event
Name of the Service sending the event
event_name
Name of the Event
Name of the Event
payload
Serializable Payload to be sent
Serializable Payload to be sent
amqp_uri
URI to connect to AMQP
URI to connect to AMQP
ssl
To use SSL or not
To use SSL or not
transport_options
Transport Options dict
Transport Options dict
heartbeat
AMQP Heartbeats interval
AMQP Heartbeats interval