1
0
forked from bot/app

分离magicocacroterline

This commit is contained in:
2024-10-13 02:51:33 +08:00
parent a77f97fd4b
commit db385f597b
91 changed files with 3681 additions and 3117 deletions

22
tests/test_ipc.py Normal file
View File

@ -0,0 +1,22 @@
from liteyuki.comm import Channel as Chan
from multiprocessing import Process
def p1(chan: Chan):
for i in range(10):
chan.send(i)
def p2(chan: Chan):
while True:
print(chan.recv())
def test_ipc():
chan = Chan("Name")
p1_proc = Process(target=p1, args=(chan,))
p2_proc = Process(target=p2, args=(chan,))
p1_proc.start()
p2_proc.start()