[Zope] (newbie) External Method continues to run.

Passin, Tom tpassin@mitretek.org
Fri, 3 Jan 2003 16:53:12 -0500


[ working4aliving]
>=20
> Hello group,
> I'm validating the resolution of url's supplied by customers=20
> through the following... (testing w/ 7000 records right now)=20
> my DTML method calls a python script that calls a zsql=20
> method.  It then passes the result (row by row) to a hacked=20
> version of webclient.py, and my result gets passed back (1 or=20
> 0).  I list the results (failures) in a resulting method. If=20
> I cancel the request (via the stop button on the browser)  my=20
> logging shows the external method contining to run. Realizing=20
> that it's server side, it's not necessarily wrong, but if=20
> anyone can give me an explaination on why (or more like how=20
> to stop it), that'd be great.
>=20
> Thanks for your help in advance.
>=20
>=20
To get the server to do something, you have to send it a message.  In
principle, if the browser closes the connection the server might see a
socket error, but I do not think that Zope gives you access to that.
Besides, then you would probably have to handle all the socket errors
yourself, which you do not want to get into.  Maybe Dieter or someone
else knows how you could pursue this approach.

Supposing that you had a link on the page that let the browser send a
message to the server.  You could click on the link after cancelling the
page.  Well, the external method is still busy, and the server is not
going to be able to talk to it unless it is multi-threaded (which would
get complicated) or unless you had the server set a value in a file
somewhere that the external method periodically checks.

If you did that, you would have to track which instance of the external
method gets which signal, so that you would have to track sessions.

The whole thing seems so tricky that it would best be left undone except
under great duress.

Cheers,

Tom P