Automated update of Base Application package.

This commit is contained in:
bot 2024-12-21 11:30:52 +00:00
parent 626b090d23
commit 7e45775c2c
5 changed files with 13 additions and 4 deletions

Binary file not shown.

BIN
dist/app-1.0.0.tar.gz vendored

Binary file not shown.

View File

@ -5,8 +5,10 @@ src/app/__main__.py
src/app/agent.py src/app/agent.py
src/app/app.py src/app/app.py
src/app/args.py src/app/args.py
src/app/cache.py
src/app/cli.py src/app/cli.py
src/app/kim.py src/app/kim.py
src/app/queue.py
src/app/repl.py src/app/repl.py
src/app/rpc.py src/app/rpc.py
src/app/server.py src/app/server.py

View File

@ -25,10 +25,11 @@
# SOFTWARE. # SOFTWARE.
import time
import asyncio import asyncio
import time
from functools import wraps from functools import wraps
def time_cache(timeout: int = 600): def time_cache(timeout: int = 600):
def decorator(func): def decorator(func):
cache = {} cache = {}
@ -48,8 +49,10 @@ def time_cache(timeout: int = 600):
return result return result
return wrapper return wrapper
return decorator return decorator
def time_cache_async(timeout: int = 600): def time_cache_async(timeout: int = 600):
def decorator(func): def decorator(func):
cache = {} cache = {}
@ -69,8 +72,10 @@ def time_cache_async(timeout: int = 600):
return result return result
return wrapper return wrapper
return decorator return decorator
@cache_time_async(timeout=600) @cache_time_async(timeout=600)
async def expensive_async_calculation(x, y): async def expensive_async_calculation(x, y):
print("Computing...") print("Computing...")

View File

@ -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. # 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 import asyncio
from collections import deque
from functools import wraps
class CallQueue: class CallQueue:
def __init__(self): def __init__(self):
@ -25,6 +26,7 @@ class CallQueue:
@wraps(func) @wraps(func)
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):
self.call_queue.append((func, args, kwargs)) self.call_queue.append((func, args, kwargs))
return wrapper return wrapper
async def execute_next(self): async def execute_next(self):
@ -41,4 +43,4 @@ class CallQueue:
results = [] results = []
while self.call_queue: while self.call_queue:
results.append(await self.execute_next()) results.append(await self.execute_next())
return results return results