<div dir="ltr"><div><div><div><div>Hello,<br><br></div>I'm using py-Asterisk 0.5.3.<br></div>I'm trying to use it along a Tkinter-based GUI so I've dedicated a thread for reading incoming AMI events.<br><br></div>
Which is the preferred way to gracefully exit from an event loop ?<br>More precisely:<br><br></div><div><br></div><div>This thread is waiting for input events with Manager._read_packet() method.<br></div><div>Doc (see [1]) says:<br>
"...  infinite loop
    running <code>BaseManager.read()</code> until an exception occurs (for
    example, <code>SystemExit</code> is raised) or until
    <code>sys.exit()</code> is called"<br><br><br></div><div>The best method I could find is to close Manager connection and catch exception.<br><br></div><div>Any advice ?<br></div><div><br></div><div>Regards<br></div>
<div><br><br><br>[1] <a href="http://py-asterisk.googlecode.com/hg-history/242456f432f2fa2727b26d648bcf7dc502fdcc51/doc/GUIDE.html">http://py-asterisk.googlecode.com/hg-history/242456f432f2fa2727b26d648bcf7dc502fdcc51/doc/GUIDE.html</a><br>
</div></div>