On Fri, Sep 4, 2009 at 2:38 PM, jim white <jbw2...@earthlink.net> wrote:

> It's a web app that draws maps in a browser. Sometime it will generate a
> seg fault. The command should not take long, so if there is some script
> construct that will throw an exception after a few seconds if the command
> has not completed I could signal the user that the map will not draw and to
> reload the page.

There's a pecl extension called Libevent that can apparently trigger an
action to occur after a certain amount of time has elapsed:


I've not used it and have no idea how mature or reliable it is. I'm also
wondering whether any solution will work that relies on the same script
that's about to trigger a segfault.

I think I'd be inclined to build an XHR-based monitor to run in the user's
browser. Even simpler would be to start the map-building process
asynchronously with XHR and then just alert the user, or automatically
refresh the browser, if a certain amount of time elapses before you get a
response from the map-building script. But I don't know how much you'd have
to alter your existing client-side code to use the latter method.

Either way it's creeping away from PHP so maybe I should leave it at that.


Reply via email to