Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 850 Bytes

README.rst

File metadata and controls

41 lines (26 loc) · 850 Bytes

async-cache

info:A caching solution for asyncio
https://travis-ci.org/iamsinghrajat/async-cache.svg?branch=master

Installation

pip install async-cache

Basic Usage

# LRU Cache
from cache import AsyncLRU

@AsyncLRU(maxsize=128)
async def func(*args, **kwargs):
    pass


# TTL Cache
from cache import AsyncTTL

@AsyncTTL(time_to_live=60, min_cleanup_interval=60)
async def func(*args, **kwargs):
    pass

Supports primitive as well as non-primitive function parameter.

Currently TTL & LRU cache is supported.