diff --git a/dist/app-1.0.0-py3-none-any.whl b/dist/app-1.0.0-py3-none-any.whl index 1aeb111..3391f8b 100644 Binary files a/dist/app-1.0.0-py3-none-any.whl and b/dist/app-1.0.0-py3-none-any.whl differ diff --git a/dist/app-1.0.0.tar.gz b/dist/app-1.0.0.tar.gz index ffa7b50..4b0ea14 100644 Binary files a/dist/app-1.0.0.tar.gz and b/dist/app-1.0.0.tar.gz differ diff --git a/src/app.egg-info/SOURCES.txt b/src/app.egg-info/SOURCES.txt index b813992..e8078a4 100644 --- a/src/app.egg-info/SOURCES.txt +++ b/src/app.egg-info/SOURCES.txt @@ -5,8 +5,10 @@ src/app/__main__.py src/app/agent.py src/app/app.py src/app/args.py +src/app/cache.py src/app/cli.py src/app/kim.py +src/app/queue.py src/app/repl.py src/app/rpc.py src/app/server.py diff --git a/src/app/cache.py b/src/app/cache.py index d6365d9..0e8411a 100644 --- a/src/app/cache.py +++ b/src/app/cache.py @@ -25,10 +25,11 @@ # SOFTWARE. -import time import asyncio +import time from functools import wraps + def time_cache(timeout: int = 600): def decorator(func): cache = {} @@ -48,8 +49,10 @@ def time_cache(timeout: int = 600): return result return wrapper + return decorator + def time_cache_async(timeout: int = 600): def decorator(func): cache = {} @@ -69,8 +72,10 @@ def time_cache_async(timeout: int = 600): return result return wrapper + return decorator + @cache_time_async(timeout=600) async def expensive_async_calculation(x, y): print("Computing...") diff --git a/src/app/queue.py b/src/app/queue.py index 2293e76..25c6bdd 100644 --- a/src/app/queue.py +++ b/src/app/queue.py @@ -13,9 +13,10 @@ # Copies or substantial portions of the Software are reproduced and must include the above copyright notice and other similar permission notice in this particular software, including in any accompanying documentation. -from functools import wraps -from collections import deque import asyncio +from collections import deque +from functools import wraps + class CallQueue: def __init__(self): @@ -25,6 +26,7 @@ class CallQueue: @wraps(func) def wrapper(*args, **kwargs): self.call_queue.append((func, args, kwargs)) + return wrapper async def execute_next(self): @@ -41,4 +43,4 @@ class CallQueue: results = [] while self.call_queue: results.append(await self.execute_next()) - return results \ No newline at end of file + return results