对通道类添加类型检查和泛型

This commit is contained in:
2024-08-17 17:41:56 +08:00
parent 03057c8ef9
commit f980e77a4a
3 changed files with 109 additions and 21 deletions

View File

@ -197,7 +197,6 @@ shared_memory: Optional[KeyValueStore] = None
if IS_MAIN_PROCESS:
shared_memory = GlobalKeyValueStore.get_instance()
@shared_memory.passive_chan.on_receive(lambda d: d[0] == "get")
def on_get(data: tuple[str, str, any, Channel]):
data[3].send(shared_memory.get(data[1], data[2]))