Responding at arbitrary timing with Jersey on Grizzly using Timer.schedule

341 Views Asked by At

all. Thanks in advance.

I am creating a RESTful service with Jersey on Grizzly. In the service, I would like to wait responding to a request for several seconds using "Timer.schedule", instead of using "Thread.sleep", which is a blocking operation.

However, "return" seems to be an only way to respond a request in Jersey. So, I have not figured out the way to do this. If you have any idea doing this, would you please advice me how to do this?

I am using Jersey-1.4 and Grizzly-1.9.32, without Maven.
Thank you very much. Best regards.

1

There are 1 best solutions below

1
On

Take a look at this question, it may be of help to you.