multiprocessing and accessing server's stdout

Tim Arnold a_jtim at bellsouth.net
Thu May 27 11:36:45 EDT 2010


On May 26, 4:52 pm, Adam Tauno Williams <awill... at whitemice.org>
wrote:
> On Wed, 2010-05-26 at 11:47 -0700, Tim Arnold wrote:
> > Hi,
> > I'm using multiprocessing's BaseManager to create a server on one
> > machine and a client on another. The client fires a request and the
> > server does some work, the result of which ends up on a shared file
> > system that both the client and server can see.
> > However, I need the client machine to see the stdout of the process
> > running on the server. Not sure this is doable--I've been unable to
> > google anything useful on this one.
>
> Nope, it isn't.  Don't use stdout, use an IPC mechanism to communicate
> between the client and the server if you need feedback.
> --
> Adam Tauno Williams <awill... at whitemice.org> LPIC-1, Novell CLA
> <http://www.whitemiceconsulting.com>
> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba

Thanks for that info, it saves me some time. This is a new area for me
though: do you redirect stdout on the server to a socket and have the
client listen and somehow pipe the sockets contents to the client
stdout?

Interestingly, the RPYc package manages it--that is, the client gets
the stdout of the server process, so I'll dig into that code to get an
idea. In the meantime, are there any recipes or other docs that would
be helpful? I've been googling but without much luck.

thanks,
--Tim



More information about the Python-list mailing list