[Zope] Zope, Threads and Signals

Wilkinson Charlie E Charlie.E.Wilkinson@irs.gov
Fri, 6 Oct 2000 18:08:56 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C02FE2.05E0E2F4
Content-Type: text/plain;
	charset="iso-8859-1"

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.

------_=_NextPart_001_01C02FE2.05E0E2F4
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>Zope, Threads and Signals</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>It all began when I was a small child, but I'll skip =
ahead a bit....&nbsp; Last night I wrote a network client class with =
plans to use it as an External Method in Zope.&nbsp; Works great from =
the command line.&nbsp; My first real Python program.&nbsp; Mom and Dad =
were so proud!&nbsp; However, when I plugged it into Zope and tried to =
call it from a document method, I got this:</FONT></P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>Error =
Type: ValueError</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>Error =
Value: signal only works in main thread</FONT>
</P>

<P><FONT SIZE=3D2>Gack!!&nbsp; Um...&nbsp; Silly me, but I wrote all =
this code to use sigalarm and blocking I/O.&nbsp; Anyone know how I can =
overcome this great adversity, aside from rewriting it all to use =
non-blocking I/O?&nbsp; Know of any good examples of External Method =
network clients you could point me at?&nbsp; Or would making it a Zope =
Product somehow fix everything?&nbsp; (Sorry, I had to =
ask...)</FONT></P>

<P><FONT SIZE=3D2>-cw-</FONT>
</P>

<P><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Charlie Wilkinson</FONT>
<BR><FONT SIZE=3D2>TRIS Development Systems Administrator </FONT>
<BR><FONT SIZE=3D2>IS:SD:CT:CC:TD</FONT>
<BR><FONT SIZE=3D2>Phone: 202-283-3241 </FONT>
<BR><FONT SIZE=3D2>MSMail:&nbsp;&nbsp; =
Charlie.E.Wilkinson@irs.gov</FONT>
<BR><FONT SIZE=3D2>SMTP:&nbsp; cwilkins@tris.irs.gov</FONT>
<BR><FONT SIZE=3D2>Home:&nbsp; cwilkins@boinklabs.com </FONT>
<BR><FONT SIZE=3D2>This message constructed from 90% post-consumer =
electrons.</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C02FE2.05E0E2F4--