|
|
@@ -34,10 +34,11 @@ namespace DotNetCore.CAP.Processor |
|
|
|
_sender = sender; |
|
|
|
_executor = executor; |
|
|
|
|
|
|
|
_publishedChannel = Channel.CreateUnbounded<MediumMessage>(new UnboundedChannelOptions() { SingleReader = true, SingleWriter = true }); |
|
|
|
_publishedChannel = Channel.CreateUnbounded<MediumMessage>(new UnboundedChannelOptions() { SingleReader = false, SingleWriter = true }); |
|
|
|
_receivedChannel = Channel.CreateUnbounded<(MediumMessage, ConsumerExecutorDescriptor)>(); |
|
|
|
|
|
|
|
Task.Factory.StartNew(Sending, _cts.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default); |
|
|
|
Task.WhenAll(Enumerable.Range(0, options.Value.ProducerThreadCount) |
|
|
|
.Select(_ => Task.Factory.StartNew(Sending, _cts.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default)).ToArray()); |
|
|
|
|
|
|
|
Task.WhenAll(Enumerable.Range(0, options.Value.ConsumerThreadCount) |
|
|
|
.Select(_ => Task.Factory.StartNew(Processing, _cts.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default)).ToArray()); |
|
|
|