Skip to content

Commit e01ac0f

Browse files
committed
Fixes: using ValueTask to avoid thread blocking when enable UseDispatchingPerGroup option. (#1356)
1 parent 41b43f8 commit e01ac0f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/DotNetCore.CAP/Processor/IDispatcher.PerGroup.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,13 @@ public void Dispose()
200200
});
201201

202202
Task.WhenAll(Enumerable.Range(0, _options.ConsumerThreadCount)
203-
.Select(_ => Task.Run(() => Processing(group, channel), _tasksCts!.Token)).ToArray());
203+
.Select(_ => Task.Run(() => Processing(group, channel), _tasksCts!.Token)).ToArray());
204204

205205
return channel;
206206
});
207207
}
208208

209-
private async Task Sending()
209+
private async ValueTask Sending()
210210
{
211211
try
212212
{
@@ -232,7 +232,7 @@ private async Task Sending()
232232
}
233233
}
234234

235-
private async Task Processing(string group, Channel<(MediumMessage, ConsumerExecutorDescriptor?)> channel)
235+
private async ValueTask Processing(string group, Channel<(MediumMessage, ConsumerExecutorDescriptor?)> channel)
236236
{
237237
try
238238
{

0 commit comments

Comments
 (0)