o
    Á¿i  ã                   @   s   d Z ddlmZ dgZdS )a¤  
The tracer supports both `Flask-Cache <https://pythonhosted.org/Flask-Cache/>`_
and `Flask-Caching <https://flask-caching.readthedocs.io/>`_.

To initialize a traced cache::

    Cache = get_traced_cache(service='my-flask-cache-app')

Here is the end result, in a sample app::

    from flask import Flask

    from ddtrace.contrib.flask_cache import get_traced_cache

    app = Flask(__name__)

    # get the traced Cache class
    Cache = get_traced_cache(service='my-flask-cache-app')

    # use the Cache as usual with your preferred CACHE_TYPE
    cache = Cache(app, config={'CACHE_TYPE': 'simple'})

    def counter():
        # this access is traced
        conn_counter = cache.get("conn_counter")

Use a specific ``Cache`` implementation with::

    from ddtrace.contrib.flask_cache import get_traced_cache

    from flask_caching import Cache

    Cache = get_traced_cache(service='my-flask-cache-app', cache_cls=Cache)

é    )Úget_traced_cacher   N)Ú__doc__Ú*ddtrace.contrib.internal.flask_cache.patchr   Ú__all__© r   r   úO/home/ubuntu/.local/lib/python3.10/site-packages/ddtrace/contrib/flask_cache.pyÚ<module>   s    $
