<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-cite-prefix">On 07/15/2014 09:26 PM, Chris Angelico
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAPTjJmoU2qbeMamfHeSkWRrqm3Z-u0fxdcP1O-vp-zZCawkZKQ@mail.gmail.com"
      type="cite">
      <pre wrap="">On Wed, Jul 16, 2014 at 6:32 AM, Charles Hixson
<a class="moz-txt-link-rfc2396E" href="mailto:charleshixsn@earthlink.net"><charleshixsn@earthlink.net></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">from queue import Empty, Full
</pre>
      </blockquote>
      <pre wrap="">
Not sure what this is for, you never use those names (and I don't have
a 'queue' module to import from). Dropped that line. In any case, I
don't think it's your problem...

</pre>
      <blockquote type="cite">
        <pre wrap="">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) )
</pre>
      </blockquote>
      <pre wrap="">
... which is here. You're not starting a subprocess; you're simply
calling a method, so it runs synchronously. When you call .run(), it
runs the "subprocess" to completion, which then bombs because the
queue's empty, and then never gets to putting anything onto it. Change
that .run() to .start() and it'll do as you expect, except that as
part of cutting the example down you seem to have omitted the
definition of wrd. I changed that to a quoted string and it works:

# chomp unchanged code ...
if __name__ == "__main__":
    dbw    =    DBW(DBW_to, DBW_from)
    dbw.start()
    DBW_to.put(Msg("a", 1, 'wrd') )
    DBW_to.put(Msg("b", 2, 'wrd') )
    DBW_to.put(Msg("c", 0, None) )

rosuav@sikorsky:~$ python test7a.py
msg = Msg(act='a', id=1, vals='wrd')

Hope that helps!

ChrisA
</pre>
    </blockquote>
    Thank you.  I had forgotten that one wasn't supposed to call run
    directly.  <br>
    FWIW, I import Empty and Full because the multiprocessor
    documentations says in <br>
    <h3>17.2.2.2. Pipes and Queues</h3>
    <div class="admonition note">
      <p class="first admonition-title">Note</p>
      <p class="last"><a class="reference internal"
          href="cid:part1.05080901.05000005@earthlink.net"
          title="multiprocessing: Process-based parallelism."><tt
            class="xref py py-mod docutils literal"><span class="pre">multiprocessing</span></tt></a>
        uses the usual <a class="reference internal"
          href="cid:part2.06060100.00020506@earthlink.net"
          title="queue.Empty"><tt class="xref py py-exc docutils
            literal"><span class="pre">queue.Empty</span></tt></a> and
        <a class="reference internal"
          href="cid:part3.01060608.01040702@earthlink.net"
          title="queue.Full"><tt class="xref py py-exc docutils literal"><span
              class="pre">queue.Full</span></tt></a> exceptions to
        signal a timeout. They are not available in
        the <a class="reference internal"
          href="cid:part1.05080901.05000005@earthlink.net"
          title="multiprocessing: Process-based parallelism."><tt
            class="xref py py-mod docutils literal"><span class="pre">multiprocessing</span></tt></a>
        namespace so you need to import them from
        <a class="reference internal"
          href="cid:part5.09090108.07050309@earthlink.net" title="queue:
          A synchronized queue class."><tt class="xref py py-mod
            docutils literal"><span class="pre">queue</span></tt></a>.</p>
    </div>
    They aren't used in the stripped down test, but they are used in the
    real code
  </body>
</html>