public class BufferedChannel<T>
{
private readonly Channel<T> _input;
private readonly Channel<IReadOnlyCollection<T>> _output;
public BufferedChannel(TimeSpan time, int maxItems)
{
_input = Channel.CreateBounded<T>(maxItems);
_output = Channel.CreateBounded<IReadOnlyCollection<T>>(1);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Threading.Channels; | |
using Confluent.Kafka; | |
using Microsoft.Extensions.Logging; | |
namespace Worker1; | |
public delegate Task MessageHandler(ConsumeResult<string, byte[]> result, Action acknowledge, CancellationToken cancellationToken); | |
public class ConcurrentKafkaReceiver : IAsyncDisposable | |
{ |