Zope, Threads and Signals
It all began when I was a small child, but I'll skip ahead a bit.... Last night I wrote a network client class with plans to use it as an External Method in Zope. Works great from the command line. My first real Python program. Mom and Dad were so proud! However, when I plugged it into Zope and tried to call it from a document method, I got this: Error Type: ValueError Error Value: signal only works in main thread Gack!! Um... Silly me, but I wrote all this code to use sigalarm and blocking I/O. Anyone know how I can overcome this great adversity, aside from rewriting it all to use non-blocking I/O? Know of any good examples of External Method network clients you could point me at? Or would making it a Zope Product somehow fix everything? (Sorry, I had to ask...) -cw- -- Charlie Wilkinson TRIS Development Systems Administrator IS:SD:CT:CC:TD Phone: 202-283-3241 MSMail: Charlie.E.Wilkinson@irs.gov SMTP: cwilkins@tris.irs.gov Home: cwilkins@boinklabs.com This message constructed from 90% post-consumer electrons.
I would just use the asynchronous network clients in asyncore and asynchat. Since ZServer also uses them you would be automagically plugged into the ZServer select loop if you were sitting behind ZServer. --jfarr ----- Original Message ----- From: "Wilkinson Charlie E" <Charlie.E.Wilkinson@irs.gov> To: <zope@zope.org> Sent: Friday, October 06, 2000 3:08 PM Subject: [Zope] Zope, Threads and Signals
It all began when I was a small child, but I'll skip ahead a bit.... Last night I wrote a network client class with plans to use it as an External Method in Zope. Works great from the command line. My first real Python program. Mom and Dad were so proud! However, when I plugged it into Zope and tried to call it from a document method, I got this:
Error Type: ValueError Error Value: signal only works in main thread
Gack!! Um... Silly me, but I wrote all this code to use sigalarm and blocking I/O. Anyone know how I can overcome this great adversity, aside from rewriting it all to use non-blocking I/O? Know of any good examples of External Method network clients you could point me at? Or would making it a Zope Product somehow fix everything? (Sorry, I had to ask...)
-cw-
-- Charlie Wilkinson TRIS Development Systems Administrator IS:SD:CT:CC:TD Phone: 202-283-3241 MSMail: Charlie.E.Wilkinson@irs.gov SMTP: cwilkins@tris.irs.gov Home: cwilkins@boinklabs.com This message constructed from 90% post-consumer electrons.
cw, Are you spawning additional threads by chance? Or just the threads that Zope creates? Knight knight@phunc.com On Fri, 6 Oct 2000, Wilkinson Charlie E wrote:
It all began when I was a small child, but I'll skip ahead a bit.... Last night I wrote a network client class with plans to use it as an External Method in Zope. Works great from the command line. My first real Python program. Mom and Dad were so proud! However, when I plugged it into Zope and tried to call it from a document method, I got this:
Error Type: ValueError Error Value: signal only works in main thread
Gack!! Um... Silly me, but I wrote all this code to use sigalarm and blocking I/O. Anyone know how I can overcome this great adversity, aside from rewriting it all to use non-blocking I/O? Know of any good examples of External Method network clients you could point me at? Or would making it a Zope Product somehow fix everything? (Sorry, I had to ask...)
-cw-
-- Charlie Wilkinson TRIS Development Systems Administrator IS:SD:CT:CC:TD Phone: 202-283-3241 MSMail: Charlie.E.Wilkinson@irs.gov SMTP: cwilkins@tris.irs.gov Home: cwilkins@boinklabs.com This message constructed from 90% post-consumer electrons.
Wilkinson Charlie E wrote:
It all began when I was a small child, but I'll skip ahead a bit....
I almost hate to say this, since your post is an interesting one otherwise, but please don't send HTML email to the list. Some of the people here don't use HTML-capable mail clients. Thanks, Michael Bernstein.
participants (4)
-
Jonothan Farr -
knight -
Michael Bernstein -
Wilkinson Charlie E