S
Srijayanth Sridhar
Hello,
I have a script that launches a bunch of threads. Each thread sleeps
for the most part, wakes up, fetches a page, does some parsing, and
goes back to sleep again. Really simple. However, on occasion, either
the parser or the httpclient raises an exception and the thread dies.
I can set Thread.abort_on_exception to true. But I'd much rather that
the thread just restarts. More often than not these exceptions are not
cause enough for the thread to die.
Someone suggested to me on the ruby irc channel to wrap the thread in
a class that will restart itself if the thread died. Does anyone have
any decent example of this or any suggestion regarding the matter?
Thank you,
J
I have a script that launches a bunch of threads. Each thread sleeps
for the most part, wakes up, fetches a page, does some parsing, and
goes back to sleep again. Really simple. However, on occasion, either
the parser or the httpclient raises an exception and the thread dies.
I can set Thread.abort_on_exception to true. But I'd much rather that
the thread just restarts. More often than not these exceptions are not
cause enough for the thread to die.
Someone suggested to me on the ruby irc channel to wrap the thread in
a class that will restart itself if the thread died. Does anyone have
any decent example of this or any suggestion regarding the matter?
Thank you,
J