小编Sum*_*mar的帖子

用于Java中断路器的Hystrix配置

我正在写一个应用程序,我想实现断路器模式.这是我写的Hystrix Command类:

public class HystrixCommandNextGen extends HystrixCommand<ScriptContext> {

    private ScriptContext scriptctx;
    private ScriptFactory scriptFactory;
    private ScriptContext responseContext = null;

    private Logger logger = LoggerFactory.getLogger(HystrixCommandNextGen.class);

    public HystrixCommandNextGen(ScriptContext scriptctx, ScriptFactory scriptFactory) {
        super(
            Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("Thread_Pool"))
            .andCommandKey(HystrixCommandKey.Factory.asKey(scriptctx.getExecutionData(ExecutionParam.SCRIPTNAME)))
        );
        this.scriptctx = scriptctx;
        this.scriptFactory = scriptFactory;

        HystrixCommandProperties.Setter().withCircuitBreakerEnabled(true);
        HystrixCommandProperties.Setter().withCircuitBreakerRequestVolumeThreshold(150);
    }

    @Override
    protected ScriptContext run() throws Exception {
        scriptFactory.execute(scriptctx);
        return scriptctx;
    }

    @Override
    protected ScriptContext getFallback() {
        logger.error("FI is not responding: Error occurred in the execution of " + getClass().getSimpleName());
        return scriptctx;
    }
}
Run Code Online (Sandbox Code Playgroud)

我无法理解如何配置线程数,断路器的阈值时间和要处理的请求数.

java netflix circuit-breaker hystrix

5
推荐指数
2
解决办法
1万
查看次数

Rust 中的 Unix 选择系统调用

我有一个文件描述符列表,我想找到所有可以阅读的内容。到目前为止,我正在使用下面的函数来做 python select.select(read_fds, [], [], 1),它返回准备读取流的列表。我正在尝试在 Rust 中做同样的事情。我正在使用 nix crate,但是函数select 只返回准备读取的文件描述符的数量。有没有办法获取文件描述符列表?

unix rust

2
推荐指数
1
解决办法
143
查看次数

如何在xcode 5.1中使用OpenMP库?

我想在我的项目中使用openMP库,但似乎在xcode 5.1中没有openMP选项.如果有人知道那么请帮助我

macos openmp xcode5

1
推荐指数
1
解决办法
3456
查看次数

标签 统计

circuit-breaker ×1

hystrix ×1

java ×1

macos ×1

netflix ×1

openmp ×1

rust ×1

unix ×1

xcode5 ×1