From ff59ee4676a512fb97cec4f5c1cbbcc72e41e465 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 8 Jun 2018 23:47:45 +0200 Subject: [PATCH] =?UTF-8?q?[mo=C3=83d]=20uses=20thread=20to=20allow=20call?= =?UTF-8?q?back=20to=20modify=20the=20context?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- moulinette/utils/stream.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/moulinette/utils/stream.py b/moulinette/utils/stream.py index 46b6ff88..13c7ff3f 100644 --- a/moulinette/utils/stream.py +++ b/moulinette/utils/stream.py @@ -1,3 +1,5 @@ +import threading + from multiprocessing.process import Process from multiprocessing.queues import SimpleQueue @@ -55,6 +57,6 @@ def async_file_reading(fd, callback): queue = SimpleQueue() reader = AsynchronousFileReader(fd, queue) reader.start() - consummer = Process(target=consume_queue, args=(queue, callback)) + consummer = threading.Thread(target=consume_queue, args=(queue, callback)) consummer.start() return (reader, consummer)