🐛 修复无法重启进程的问题(未启动生命监视器)
This commit is contained in:
@ -27,7 +27,7 @@ SYNC_FILTER_FUNC: TypeAlias = Callable[[Any], bool]
|
||||
ASYNC_FILTER_FUNC: TypeAlias = Callable[[Any], Awaitable[bool]]
|
||||
FILTER_FUNC: TypeAlias = SYNC_FILTER_FUNC | ASYNC_FILTER_FUNC
|
||||
|
||||
IS_MAIN_PROCESS = multiprocessing.current_process().name == "MainProcess"
|
||||
|
||||
|
||||
_channel: dict[str, "Channel"] = {}
|
||||
_callback_funcs: dict[str, ON_RECEIVE_FUNC] = {}
|
||||
|
14
liteyuki/comm/shared_memory.py
Normal file
14
liteyuki/comm/shared_memory.py
Normal file
@ -0,0 +1,14 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
共享内存模块。类似于redis,但是更加轻量级。
|
||||
"""
|
||||
|
||||
memory_database = {}
|
||||
|
||||
|
||||
def set_memory(key: str, value: any) -> None:
|
||||
pass
|
||||
|
||||
|
||||
def get_mem_data(key: str) -> any:
|
||||
pass
|
@ -87,6 +87,8 @@ class ProcessManager:
|
||||
else:
|
||||
logger.warning("Unknown data received, ignored.")
|
||||
|
||||
_start_monitor()
|
||||
|
||||
def start_all(self):
|
||||
"""
|
||||
启动所有进程
|
||||
|
@ -4,11 +4,13 @@
|
||||
"""
|
||||
import asyncio
|
||||
import inspect
|
||||
import multiprocessing
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable, Coroutine
|
||||
|
||||
from liteyuki.log import logger
|
||||
|
||||
IS_MAIN_PROCESS = multiprocessing.current_process().name == "MainProcess"
|
||||
|
||||
def is_coroutine_callable(call: Callable[..., Any]) -> bool:
|
||||
"""
|
||||
|
Reference in New Issue
Block a user