仅当有订阅的消费者时才将数据从 java 推送到 flex
我读过以下关于如何从 BlazeDS 推送数据而不接收来自 Flex 客户端的消息的文章?我没有在该线程上发布,因为它很旧。
我已经实现了这样的机制,并且看起来效果很好。我唯一没能做的就是在客户端关闭时停止线程。我的预感是客户端已关闭,但消费者并未取消订阅,除非未调用 unsubscribe() 方法,我想说,这是正常行为。问题是,如果我想在客户端(在我的例子中是浏览器)关闭时调用取消订阅方法,我在flex web中没有找到这样的处理程序(例如onExiting,dispose...),仅适用于air应用程序。我正在使用 Flex 3.6 和 BlazeDS 3.2.0 开发我的应用程序。谢谢。
I've read the following post about how to push data from BlazeDS without recieve message from Flex client?. I did not posted on that thread because is old.
I've implemented such mechanism and it seems to work well. The only thing that I did not managed to do is to stop the thread, if the client is closed. My hunch is that the client is closed, but the consumer is not unsubscribed, unless the method unsubscribe() is not called and I would say, that this is a normal behavior. The problem is that if I want to call the unsubscribe method when the client (in my case a browser) is closed, I did not find such handlers (e.g onExiting, dispose...) in flex web, only for air applications. I'm developing my application using Flex 3.6 and BlazeDS 3.2.0. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Flex 中没有默认句柄。
但是,您可以尝试以下方法:
干杯
There is no default handle for that in flex.
However, what you could try is the following:
Cheers