DWR支持Grizzly Comet框架的补丁
程序员文章站
2022-06-04 08:32:03
...
Jean-Francois Arcand编写了一个DWR的补丁,可以让DWR的用户通过Reverse Engine来使用Grizzly Comet框架了。Grizzly真的是现在非常火爆的Java AJAX异步调用服务器端框架。
因为DWR也支持Jetty Continuations实现的异步调用,Jean-Francois Arcand比较了两种实现方法:
通过Jetty Continuations挂起连接:
通过Grizzly挂起连接:
Jean-Francois Arcand认为虽然Grizzly的实现方法略微复杂一些,但是Grizzly可以通过CometHandler在连接之间共享信息,要比Jetty Continuations功能强大,程序员有更多的控制能力。
也许我们应该多多关注Grizzly了。
因为DWR也支持Jetty Continuations实现的异步调用,Jean-Francois Arcand比较了两种实现方法:
通过Jetty Continuations挂起连接:
Continuation continuation = ContinuationSupport.getContinuation(request, mutex); continuation.suspend(timeout);
通过Grizzly挂起连接:
CometContext ctx = CometEngine.getEngine().register("DWR"); CometHandler continuationHandler = new CometHandler() { public void attach(Object o) { } public void onEvent(CometEvent cometEvent) throws IOException { } public void onInitialize(CometEvent cometEvent) throws IOException { } public void onInterrupt(CometEvent cometEvent) throws IOException { } public void onTerminate(CometEvent cometEvent) throws IOException { } }; ctx.setExpirationDelay(sleepTime); ctx.addCometHandler(continuationHandler);
Jean-Francois Arcand认为虽然Grizzly的实现方法略微复杂一些,但是Grizzly可以通过CometHandler在连接之间共享信息,要比Jetty Continuations功能强大,程序员有更多的控制能力。
也许我们应该多多关注Grizzly了。
上一篇: 逻辑备库之ORA-01403解决方法
下一篇: sql server 2000 版本查询