Commits

uniqx  committed b1b9cce

update_file_queue in PyldProcess sort of successfuly tested

  • Participants
  • Parent commits 4b6c5ef
  • Branches multiprocessing

Comments (0)

Files changed (1)

File pyld/process.py

 
 import os
 import ast
+import time
 
-from multiprocessing import Process
+from multiprocessing import Process, Queue
 
 class PyldFile():
 
     """PyldProcess will execute all files from ``file_name_list``.
     """
 
-    Process.__init__(self)
+    self.update_file_queue = Queue()
+
+    Process.__init__(self,args=[self.update_file_queue])
     self.files = {}
 
     for file_name in file_name_list:
 
   def run(self):
     while True:
-      #print self.x
+      if not self.update_file_queue.empty():
+        print self.update_file_queue.get_nowait()
       time.sleep(1)
 
-  def i(self):
-    self.x += 1
+  def update_file(self,file_name):
+    self.update_file_queue.put_nowait(file_name)