public Task <IMessageDeliveryChecker> SubscribeAsync(
            string channel,
            MessageAction onExpectedMessage,
            MessageAction onMissedMessage         = default,
            MessageAction onDuplicatedMessage     = default,
            MessagesCountAction onMissingMessages = default)
        {
            var messageHandler = new MessageHandler(onExpectedMessage, onMissedMessage, onDuplicatedMessage, onMissingMessages);

            return(_subscriber.SubscribeAsync(channel, messageHandler));
        }
示例#2
0
 public MessageHandler(
     MessageAction onExpectedMessage,
     MessageAction onMissedMessage         = default,
     MessageAction onDuplicatedMessage     = default,
     MessagesCountAction onMissingMessages = default)
 {
     _onExpectedMessage   = onExpectedMessage;
     _onMissedMessage     = onMissedMessage ?? onExpectedMessage;
     _onDuplicatedMessage = onDuplicatedMessage ?? _noop;
     _onMissingMessages   = onMissingMessages ?? _noop2;
 }