1
0
mirror of synced 2024-11-15 01:33:51 +00:00
PettingZoo/PettingZoo.Core/Connection/IConnection.cs
Mark van Renswoude 2e6524f3b9 Implemented connection profiles
Added unread messages counter to deactivated subscriber tabs
Added feature to reply to a new subscriber tab
2021-12-18 12:18:35 +01:00

39 lines
813 B
C#

using System;
using System.Threading.Tasks;
namespace PettingZoo.Core.Connection
{
public interface IConnection : IAsyncDisposable
{
event EventHandler<StatusChangedEventArgs> StatusChanged;
ISubscriber Subscribe(string exchange, string routingKey);
ISubscriber Subscribe();
Task Publish(PublishMessageInfo messageInfo);
}
public enum ConnectionStatus
{
Disconnected,
Connecting,
Connected,
Error
}
public class StatusChangedEventArgs : EventArgs
{
public ConnectionStatus Status { get; }
public string? Context { get; }
public StatusChangedEventArgs(ConnectionStatus status, string? context)
{
Status = status;
Context = context;
}
}
}