您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
26 行
625 B
26 行
625 B
using System;
|
|
|
|
namespace Unity.Multiplayer.Samples.BossRoom.Shared.Infrastructure
|
|
{
|
|
public interface IPublisher<T>
|
|
{
|
|
void Publish(T message);
|
|
}
|
|
|
|
public interface ISubscriber<T>
|
|
{
|
|
IDisposable Subscribe(Action<T> handler);
|
|
}
|
|
|
|
public interface IMessageChannel<T> : IPublisher<T>, ISubscriber<T>, IDisposable
|
|
{
|
|
bool IsDisposed { get; }
|
|
void Unsubscribe(Action<T> handler);
|
|
}
|
|
|
|
public interface IBufferedMessageChannel<T> : IMessageChannel<T>
|
|
{
|
|
bool HasBufferedMessage { get; }
|
|
T BufferedMessage { get; }
|
|
}
|
|
}
|