使用 Timer.schedule 在 Grizzly 上的 Jersey 上以任意时间响应
全部。提前致谢。
我正在 Grizzly 上使用 Jersey 创建 RESTful 服务。在服务中,我想使用“Timer.schedule”等待响应请求几秒钟,而不是使用“Thread.sleep”,这是一个阻塞操作。
然而,“返回”似乎是泽西岛回应请求的唯一方式。所以,我还没有找到方法来做到这一点。如果您有任何想法这样做,请告诉我如何做到这一点?
我正在使用 Jersey-1.4 和 Grizzly-1.9.32,没有 Maven。
非常感谢。此致。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看这个问题,可能对你有帮助。
Take a look at this question, it may be of help to you.