Я пытался использовать следующий фрагмент кода для бесконечного чтения с консоли:
def read_console(hub):
while True:
text = input("write stuff")
if text == 'y':
hub.server.invoke('Say', 'hello')
print (text)
connection = Connection('https://1234.net/signalr', session=None)
hub = connection.register_hub('echo')
read_console_process = multiprocessing.Process(target=read_console, args=(hub,))
read_console_process.start()
Однако я столкнулся с проблемой рассола и решил попробовать использовать pathos
, я попробовал следующее, ноЯ получаю сообщение об ошибке - zip argument #1 must support iteration
:
def main():
connection = Connection('https://1234.net/signalr', session=None)
hub = connection.register_hub('echo')
executor = ProcessingPool()
executor.map(read_console, hub)