H
horos11
all,
I have problem with a third party module that I'm using - the methods
inside it tend to freeze (ie: go away and not come back). The problem
is intermittent, and can happen in more than one method in the module.
The way I look at it, I've got only one choice as it stands; to run
the commands in a separate thread, and have the parent thread kill the
child thread if it hasn't exited within a certain interval. But this
is messy, not only from the extra code that I'm going to have to
write, but from
a) the need to use data from the child in the parent
b) the need for retry in case of failure
c) the need to handle any cleanup from the child.
So I was hoping that there was some support for timeouts in methods,
something like:
public String[] method(int input, int input2) throws
TimeoutException(60000)
{
...
...
}
which would handle all of the timeout and data issues for a given
function call, and throw a timeout exception if it hits 60 seconds (in
this case).
Anyways, I know something like this doesn't exist in the form stated
above, but anything remotely like it would be most welcome. Otherwise,
is there an API which handles this effectively? I'm at a loss on how
to do this cleanly..
Thanks much,
Ed
I have problem with a third party module that I'm using - the methods
inside it tend to freeze (ie: go away and not come back). The problem
is intermittent, and can happen in more than one method in the module.
The way I look at it, I've got only one choice as it stands; to run
the commands in a separate thread, and have the parent thread kill the
child thread if it hasn't exited within a certain interval. But this
is messy, not only from the extra code that I'm going to have to
write, but from
a) the need to use data from the child in the parent
b) the need for retry in case of failure
c) the need to handle any cleanup from the child.
So I was hoping that there was some support for timeouts in methods,
something like:
public String[] method(int input, int input2) throws
TimeoutException(60000)
{
...
...
}
which would handle all of the timeout and data issues for a given
function call, and throw a timeout exception if it hits 60 seconds (in
this case).
Anyways, I know something like this doesn't exist in the form stated
above, but anything remotely like it would be most welcome. Otherwise,
is there an API which handles this effectively? I'm at a loss on how
to do this cleanly..
Thanks much,
Ed