2021-11-28 13:18:21 +00:00
|
|
|
|
using System;
|
2022-01-11 19:28:49 +00:00
|
|
|
|
using System.Collections.Generic;
|
2021-11-28 13:18:21 +00:00
|
|
|
|
|
|
|
|
|
namespace PettingZoo.Core.Connection
|
|
|
|
|
{
|
|
|
|
|
public interface ISubscriber : IAsyncDisposable
|
|
|
|
|
{
|
2021-12-18 11:18:35 +00:00
|
|
|
|
string? QueueName { get; }
|
|
|
|
|
string? Exchange {get; }
|
|
|
|
|
string? RoutingKey { get; }
|
2021-11-28 13:18:21 +00:00
|
|
|
|
|
|
|
|
|
event EventHandler<MessageReceivedEventArgs>? MessageReceived;
|
|
|
|
|
|
2022-01-11 19:28:49 +00:00
|
|
|
|
IEnumerable<ReceivedMessageInfo> GetInitialMessages();
|
2021-11-28 13:18:21 +00:00
|
|
|
|
void Start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class MessageReceivedEventArgs : EventArgs
|
|
|
|
|
{
|
2021-12-06 13:08:29 +00:00
|
|
|
|
public ReceivedMessageInfo MessageInfo { get; }
|
2021-11-28 13:18:21 +00:00
|
|
|
|
|
|
|
|
|
|
2021-12-06 13:08:29 +00:00
|
|
|
|
public MessageReceivedEventArgs(ReceivedMessageInfo messageInfo)
|
2021-11-28 13:18:21 +00:00
|
|
|
|
{
|
|
|
|
|
MessageInfo = messageInfo;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|