如何等待所有Hystrix命令(线程)完成?

我正在使用javanica,并通过注释@HystrixCommand定义我的Hstrix命令。 Hystrix命令返回一个AsyncResult(Future),但是我正在寻找一种方法,等待所有命令完成,以防在同一命令上进行迭代。

最好的方法是什么?

是否有任何涉及ExecutorCompletionService的方式?

//just an example
@HystrixCommand
public Future<List<String>> find(String str) {
    return new AsyncResult<List<String>>() {
        @Override
        public List<String> invoke() {
            return str + " test";
        }
    };
}
bang2008 回答:如何等待所有Hystrix命令(线程)完成?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3075238.html

大家都在问