thanks for keeping this project alive, it's very useful.
I'm looking for a way of implementing a timeout in one of the long-running
tasks of my webware application. The application revolves around a web spider
that crawls several tech news sites and lists the results, the long-running
task is the spider itself, wrapped into a TaskKit.Task object.
I'd like to set a timeout for the run of the spider, because it depends on the
outside world, and it happens to hang in a non-predictable manner. (Yes, it
would be best to solve that problem first. Still I want the timeout)
I'm using Linux, the standard way to achieve this would be (as described in the
Python manual) to create a signal handler for SIGALRM that raises an
Exception in the main thread and set a signal.alarm() in the task that needs
For some reason, this one didn't work for me. I'm setting the signal handler in
the __init__.py of my plugin, the signal.alarm() in the spider task. However,
the alarm doesn't ring.
Question 1: Did anybody implement SIGALRM / signal.alarm() successfully for a
long-running task within the Webware framework?
Question 2: Is there any other way to achieve a timeout-like behaviour? One
idea would be to create a "watchdog" task looking after the spider task, but
then again, how do you abort a TaskKit.Task() object anynchronously?
BTW, if anyone is interested in having a look at the project, I'm happy to
share url and password/login upon request, no questions asked. I'm not posting
this freely because I'm paying huge amounts for the bandwidth used, and I fear
to expose the login data in the Webware archive.
-- Martin Virtel
aim / yahoo messenger mvftd
tel. +49 177 242 2889