I don't think I can reduce it much beyond this. I'm trying to run Sqlite in a separate process, but I'm running into problems.
*The code:*
from collections    import    namedtuple
from multiprocessing import Process, Queue, current_process
from queue import Empty, Full


Msg    =    namedtuple ("Msg", ['act', 'id', 'vals'])
DBW_to    =    Queue()
DBW_from    =    Queue()

class DBW (Process):
    def __init__ (self, qin, qout):
        self.qin    =    qin
        self.qout    =    qout
        super (DBW, self).__init__()

    def run (self):
        msg    =    self.qin.get(True, 3)
        print ("msg = {0}".format(repr(msg) ) )

if __name__ == "__main__":
    dbw    =    DBW(DBW_to, DBW_from)
    dbw.run()
    DBW_to.put(Msg("a", 1, wrd) )
    DBW_to.put(Msg("b", 2, wrd) )
    DBW_to.put(Msg("c", 0, None) )

*The result:*
Traceback (most recent call last):
  File "test7a.py", line 23, in <module>
    dbw.run()
  File "test7a.py", line 18, in run
    msg    =    self.qin.get(True, 3)
  File "/usr/lib/python3.4/multiprocessing/queues.py", line 107, in get
    raise Empty
queue.Empty

*$ python3 --version*
Python 3.4.1

*The system:*
Linux 3.14-1-amd64


-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to