1
0
mirror of synced 2024-11-15 01:33:51 +00:00
PettingZoo/PettingZoo.Core/Connection/IConnection.cs
Mark van Renswoude 2755e93440 Started major refactoring
- Upgrade to .NET 5
- Split functionality into libraries
- Tabbed interface for multiple subscribers
- Placeholder for publishing tab
2021-11-28 14:18:21 +01:00

37 lines
772 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);
Task Publish(MessageInfo 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;
}
}
}