0

I'm implementing a primitive http server and I have a handler extending SimpleChannelInboundHandler. I have a method that's processing requests and I want to make a delay after processing specific request. How should I implement the pause so that server's behaviour still conforms to standards? I mean, client (browser etc.) should not behave like connection is lost or something like that, but just wait till the necessary amount of time passes.

4

1 回答 1

1

你可以只使用:

ctx.executor().schedule(...)

这样,您可以在传递给调度调用的 Runnable 中进行写入。

于 2013-10-24T17:08:32.727 回答