🚧 process handler dependency

This commit is contained in:
yanyongyu
2021-11-12 18:10:40 +08:00
parent 57e826a835
commit c454cf0874
6 changed files with 256 additions and 166 deletions

View File

@ -1,6 +1,7 @@
import re
import json
import asyncio
import inspect
import dataclasses
from functools import wraps, partial
from typing import Any, Callable, Optional, Awaitable
@ -51,6 +52,12 @@ def run_sync(func: Callable[..., Any]) -> Callable[..., Awaitable[Any]]:
return _wrapper
def get_name(obj: Any) -> str:
if inspect.isfunction(obj) or inspect.isclass(obj):
return obj.__name__
return obj.__class__.__name__
class DataclassEncoder(json.JSONEncoder):
"""
:说明: