
    `f                     t    d Z ddlZddlmZ ddlmZ dZdZ eed          Zdeej        fd	Z	d
 Z
efdZdS )z/Creating events, and event exchange definition.    N)copy)Exchange)Eventevent_exchangeget_exchange
group_fromceleryevtopictypec                 r    |r	 ||fi |n|}d|vr |                      |            |            n| |d<   |S )zCreate an event.

    Notes:
        An event is simply a dictionary: the only required field is ``type``.
        A ``timestamp`` field will be set to the current time if not provided.
    	timestamp)r   r   r   )update)r   _fields__dict____now__fieldsevents         E/var/www/html/env/lib/python3.11/site-packages/celery/events/event.pyr   r      s]     ,3>HHW'''''E%wwyyt4444fL    c                 :    |                      dd          d         S )zGet the group part of an event type name.

    Example:
        >>> group_from('task-sent')
        'task'

        >>> group_from('custom-my-event')
        'custom'
    -   r   )splitr   s    r   r   r   !   s     ::c1a  r   c                     t          t                    }| j        j        dk    rd|_        ||j        k    r||_        |S )a8  Get exchange used for sending events.

    Arguments:
        conn (kombu.Connection): Connection used for sending/receiving events.
        name (str): Name of the exchange. Default is ``celeryev``.

    Note:
        The event type changes if Redis is used as the transport
        (from topic -> fanout).
    redisfanout)r   r   	transportdriver_typer   name)connr    exs      r   r   r   .   s?     
n		B~!W,,rwIr   )__doc__timer   kombur   __all__EVENT_EXCHANGE_NAMEr   dictr   r   r    r   r   <module>r*      s    5 5              !  -G<<< tTY    
! 
! 
! 0      r   