Advanced Distributed Systems module at HSLU
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
858 B

using System;
namespace RobotLib.Communication
{
public interface IPublisherSubscriber
{
/// <summary>
/// New message to a subscribed topic arrived.
/// </summary>
event EventHandler<SubscribedMsgArrivedEventArgs> NewMessageArrived;
/// <summary>
/// Connection state.
/// </summary>
bool IsConnected { get; }
/// <summary>
/// Subscribe to a topic.
/// </summary>
/// <param name="topic">The topic to subscribe to.</param>
void Subscribe(string topic);
/// <summary>
/// Publish message to a topic.
/// </summary>
/// <param name="topic">The topic where to publish the data to.</param>
/// <param name="message">Data to publish.</param>
void Publish(string topic, string message);
}
}