You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
572 B
C#
27 lines
572 B
C#
3 weeks ago
|
using System;
|
||
|
|
||
|
namespace Unity.BossRoom.Infrastructure
|
||
|
{
|
||
|
public interface IPublisher<T>
|
||
|
{
|
||
|
void Publish(T message);
|
||
|
}
|
||
|
|
||
|
public interface ISubscriber<T>
|
||
|
{
|
||
|
IDisposable Subscribe(Action<T> handler);
|
||
|
void Unsubscribe(Action<T> handler);
|
||
|
}
|
||
|
|
||
|
public interface IMessageChannel<T> : IPublisher<T>, ISubscriber<T>, IDisposable
|
||
|
{
|
||
|
bool IsDisposed { get; }
|
||
|
}
|
||
|
|
||
|
public interface IBufferedMessageChannel<T> : IMessageChannel<T>
|
||
|
{
|
||
|
bool HasBufferedMessage { get; }
|
||
|
T BufferedMessage { get; }
|
||
|
}
|
||
|
}
|