o
    i                     @   s`   d dl mZmZ d dlmZ d dlmZ eG dd dZeG dd dZG dd	 d	eZ	d
S )    )ABCabstractmethod)Optional)	dataclassc                   @   s&   e Zd ZU eed< eed< eed< dS )CacheContextnode_id
class_typecache_key_hashN)__name__
__module____qualname__str__annotations__ r   r   7/mnt/c/Users/fbmor/ComfyUI/comfy_api/latest/_caching.pyr      s   
 r   c                   @   s"   e Zd ZU eed< dZeed< dS )
CacheValueoutputsNui)r
   r   r   listr   r   dictr   r   r   r   r      s   
 r   c                   @   s   e Zd ZdZededee fddZedededdfdd	Z	ddedee de
fd
dZdeddfddZdeddfddZdS )CacheProviderzAbstract base class for external cache providers.
    Exceptions from provider methods are caught by the caller and never break execution.
    contextreturnc                       dS )zGCalled on local cache miss. Return CacheValue if found, None otherwise.Nr   )selfr   r   r   r   	on_lookup      zCacheProvider.on_lookupvalueNc                    r   )z=Called after local store. Dispatched via asyncio.create_task.Nr   r   r   r   r   r   r   on_store   r   zCacheProvider.on_storec                 C   s   dS )zCReturn False to skip external caching for this node. Default: True.Tr   r   r   r   r   should_cache"   s   zCacheProvider.should_cache	prompt_idc                 C      d S Nr   r   r!   r   r   r   on_prompt_start&      zCacheProvider.on_prompt_startc                 C   r"   r#   r   r$   r   r   r   on_prompt_end)   r&   zCacheProvider.on_prompt_endr#   )r
   r   r   __doc__r   r   r   r   r   r   boolr    r   r%   r'   r   r   r   r   r      s    r   N)
abcr   r   typingr   dataclassesr   r   r   r   r   r   r   r   <module>   s    