工人和与Rebus的并行性
我有以下关于线程的问题: 1以下两种方法的默认值是什么: 2工人和与Rebus的并行性,rebus,rebus-azureservicebus,Rebus,Rebus Azureservicebus,我有以下关于线程的问题: 1以下两种方法的默认值是什么: 2SetNumberOfWorkers:workers是专用线程还是通过线程池 Configure.With(...) .(...) .Options(o => { o.SetNumberOfWorkers(1); o.SetMaxParallelism(10); }) .(...) Rebus默认为1个工作线程,最大并行度为5–这在CPU上很容易实现,但如果工作是
SetNumberOfWorkers
:workers是专用线程还是通过线程池
Configure.With(...)
.(...)
.Options(o => {
o.SetNumberOfWorkers(1);
o.SetMaxParallelism(10);
})
.(...)
Rebus默认为1个工作线程,最大并行度为5–这在CPU上很容易实现,但如果工作是异步的,它仍然可以执行大量工作 工作线程是专用线程,用于克服同步API传输的限制
已相应更新:)谢谢。worker和parallelism的设置能否同时用于Publiser(排队消息)和Subscriber(出列消息)?workers/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);