From ae18bfaee1befb5eb387a3cf1a310401c2a2de7e Mon Sep 17 00:00:00 2001 From: snowykami Date: Sun, 1 Sep 2024 11:05:01 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20[channel]:=20=E6=9A=82=E5=81=9C?= =?UTF-8?q?=E9=80=9A=E9=81=93=E6=8E=A5=E6=94=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteyuki/comm/channel.py | 16 ---------------- liteyuki/core/manager.py | 2 -- 2 files changed, 18 deletions(-) diff --git a/liteyuki/comm/channel.py b/liteyuki/comm/channel.py index 594c45df..38c2a46d 100644 --- a/liteyuki/comm/channel.py +++ b/liteyuki/comm/channel.py @@ -191,22 +191,6 @@ class Channel(Generic[T]): else: [asyncio.create_task(_callback_funcs[func_id](data)) for func_id in self._on_sub_receive_func_ids] - async def start_receive_loop(self): - """ - @litedoc-hide - 开始接收数据 - 会自动判断主进程和子进程,需要在对应进程都调度一次 - """ - if len(self._on_main_receive_func_ids) == 0: - logger.warning(f"No on_receive function registered for {self.name}") - return - - self.is_receive_loop_running = True - logger.debug(f"Starting receive loop for {self.name}") - while not self._closed: - data = await self.async_receive() - await self._run_on_receive_funcs(data) - """子进程可用的主动和被动通道""" active_channel: Channel = Channel(name="active_channel") # 主动通道 diff --git a/liteyuki/core/manager.py b/liteyuki/core/manager.py index 1de7a7e4..d8768471 100644 --- a/liteyuki/core/manager.py +++ b/liteyuki/core/manager.py @@ -132,8 +132,6 @@ class ProcessManager: """ 对外启动方法,启动所有进程,创建asyncio task """ - [asyncio.create_task(chan.start_receive_loop()) for chan in get_channels().values()] - [asyncio.create_task(sm.start_receive_loop()) for sm in [shared_memory]] [asyncio.create_task(self._run_process(name)) for name in self.targets] def add_target(self, name: str, target: TARGET_FUNC, args: tuple = (), kwargs=None):