扭曲,当反应器停止时取消阻塞threads.blockingCallFromThread
即使反应堆停止,threads.blockingCallFromThread
似乎仍会阻塞。有什么办法可以解除封锁吗?它阻塞的延迟依赖于来自另一端的 RPC,并且在反应器停止时肯定不会出现。
it seems threads.blockingCallFromThread
keeps blocking even when the reactor stops. is there any way to un-block it? the deferred that it is blocking on relies on an RPC coming from the other end, and that definitely won't come in with the reactor stopped.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它会阻塞直到延迟触发。如果您希望它解锁,请触发 Deferred。如果您要停止应用程序并停止反应器,那么您可能需要在执行此操作之前触发 Deferred。您可能希望以
Failure
来触发它,因为您可能无法得出成功的结果。您可以使用自定义Service
或reactor.addSystemEventTrigger
安装reactor关闭挂钩,以便在reactor即将停止时运行代码。It blocks until the Deferred fires. If you want it to unblock, fire the Deferred. If you're stopping your application and stopping the reactor, then you might want to fire the Deferred before you do that. You probably want to fire it with a
Failure
since presumably you haven't been able to come up with a successful result. You can install reactor shutdown hooks to run code when the reactor is about to stop, either using a customService
orreactor.addSystemEventTrigger
.