// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Threading;
using DotNetCore.CAP.Messages;
using JetBrains.Annotations;
namespace DotNetCore.CAP.Transport
{
///
///
/// Message queue consumer client
///
public interface IConsumerClient : IDisposable
{
BrokerAddress BrokerAddress { get; }
///
/// Subscribe to a set of topics to the message queue
///
///
void Subscribe(IEnumerable topics);
///
/// Start listening
///
void Listening(TimeSpan timeout, CancellationToken cancellationToken);
///
/// Manual submit message offset when the message consumption is complete
///
void Commit([NotNull] object sender);
///
/// Reject message and resumption
///
void Reject([CanBeNull] object sender);
event EventHandler OnMessageReceived;
event EventHandler OnLog;
}
}