Workers 和与 Rebus 的并行性
Workers and parallelism with Rebus
我对以下线程有疑问:
1 以下两种方法的默认值是什么:
2 SetNumberOfWorkers
:worker 是专用线程还是通过线程池?
Configure.With(...)
.(...)
.Options(o => {
o.SetNumberOfWorkers(1);
o.SetMaxParallelism(10);
})
.(...)
https://github.com/rebus-org/Rebus/wiki/Workers-and-parallelism
//
// Summary:
// Configures the total degree of parallelism allowed. This will be the maximum
// number of parallel potentially asynchrounous operations that can be active, regardless
// of the number of workers
public void SetMaxParallelism(int maxParallelism);
//
// Summary:
// Configures the number of workers to start competing over the input queue
public void SetNumberOfWorkers(int numberOfWorkers);
Rebus 默认为 1 个工作线程和最大并行度 5 – 这在 CPU 上很容易,但如果工作是异步的,它仍然可以执行大量工作。
工作线程是专用线程,用于克服同步 API 传输的限制。
The wiki page 已相应更新:)
我对以下线程有疑问:
1 以下两种方法的默认值是什么:
2 SetNumberOfWorkers
:worker 是专用线程还是通过线程池?
Configure.With(...)
.(...)
.Options(o => {
o.SetNumberOfWorkers(1);
o.SetMaxParallelism(10);
})
.(...)
https://github.com/rebus-org/Rebus/wiki/Workers-and-parallelism
//
// Summary:
// Configures the total degree of parallelism allowed. This will be the maximum
// number of parallel potentially asynchrounous operations that can be active, regardless
// of the number of workers
public void SetMaxParallelism(int maxParallelism);
//
// Summary:
// Configures the number of workers to start competing over the input queue
public void SetNumberOfWorkers(int numberOfWorkers);
Rebus 默认为 1 个工作线程和最大并行度 5 – 这在 CPU 上很容易,但如果工作是异步的,它仍然可以执行大量工作。
工作线程是专用线程,用于克服同步 API 传输的限制。
The wiki page 已相应更新:)