I like to define a time(say 3, 5 or 10 minutes) for my function to run i-e if my function does not respond-back/return anything till given I like to snatch control from that function or i interrupt that function and continue as i like. I can use any thread to achieve this as well if there is any possibility in java threading.
Share
If I have understood your question correctly You can use
Futureand then you can callgetwith timeout. Note get is blocking call and it throwsTimeoutExceptionif wait timed out.