mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[moÃd] uses thread to allow callback to modify the context
This commit is contained in:
parent
cee5eb562a
commit
ff59ee4676
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue