I was trying to use the following piece of code for reading from the console indefinitely:
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()
However I ran into a pickle issue and decided to try using pathos
, I tried the following but I'm receiving the error - 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)