[Numpy-discussion] Nonblocking Plots with Matplotlib
Thu Mar 15 03:20:40 CDT 2007
Bill Baxter wrote:
> On 3/15/07, Bill Baxter <firstname.lastname@example.org> wrote:
>> Thanks, Sebastian. I'll take a look at Pyro. Hadn't heard of it.
>> I'm using just xmlrpclib with pickle right now.
> I took a look at Pyro -- it looks nice.
> The only thing I couldn't find, though, is how decouple the wx GUI on
> the server side from the Pyro remote call handler. Both wx and Pyro
> want to run a main loop.
> With the XML-RPC, I could use twisted and its wxreactor class. That
> does all the necessary magic under the hood to run both loops.
> Basically all you have to do to make it work is:
> class MainApp(wx.App, twisted.web.xmlrpc.XMLRPC):
> app = MainApp()
> And then you're good to go. reactor.run() takes care of both main
> loops somehow.
> Do you know of any good examples showing how to do that sort of thing
> with Pyro? It must be possible. I mean it's the exact same sort of
> thing you'd need if you're writing a simple GUI internet chat program.
> My googling has turned up nothing, though.
It is possible to do this with Pyro.
I think Pyro can "auto-background" (my terminology not theirs) if you
allow it to do threading. Otherwise, you could handle requests by 1)
putting Pyro in a thread you manage or 2) a GUI timer calling Pyro's
daemon.handleRequests(...) fairly often.
But I hear nothing but good things about Twisted, and your code works,
so I say find some bigger fish to fry (especially since I can see
potential issues with each of the above options...).
More information about the Numpy-discussion