Re: pyro4 stockmarket example - terminating viewer

Irmen de Jong <[email protected]>
Newsgroups gmane.comp.python.pyro
Message-ID <[email protected]>
On 8-12-2012 20:31, Michael Schubnell wrote:
> First off, the Pyro4 tutorial is outstanding and very helpful. I have worked through the
> stockmarket example and have tried to modify it so that a viewer can quit. A simple
> modification like:
> 
> try:
>       daemon.requestLoop()
> finally:
>       daemon.unregister(viewer)
> 
> doesn't work. Has anyone  successfully implemented such  a modification or can give me
> pointers as to what steps need to be taken to be able to quit a viewer (either gently or
> with ctrl-C).
> Thanks,
> Michael
> 


Try specifying a socket communication timeout (COMMTIMEOUT config item). This will
enable Python to actually process your CTRL-C keypress, instead of blocking indefinitely
in a socket I/O operation.

Alternatively, use the multiplex servertype instead of the default threaded type (see
SERVERTYPE config item).

See http://packages.python.org/Pyro4/config.html#overview-of-config-items


Good luck

Irmen de Jong




------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.