26 lines
846 B
C#
26 lines
846 B
C#
using Cysharp.Threading.Tasks;
|
|
|
|
using System.Threading;
|
|
|
|
namespace PMaker.MessagePipe.Extension
|
|
{
|
|
public static partial class BaseBehaviourExtension
|
|
{
|
|
public static async UniTask SendAsync<TKey, TValue>(this BaseBehaviour baseBehaviour, TKey key, TValue value, CancellationToken token)
|
|
{
|
|
await MessageKit.PublishAsync(key, value, token);
|
|
}
|
|
|
|
public static async UniTask<TValue> SendFuncAsync<TKey, TValue>(this BaseBehaviour baseBehaviour, TKey key, TValue value, CancellationToken token)
|
|
{
|
|
var result = await MessageKit.PublishFuncAsync(key, value, token);
|
|
return result;
|
|
}
|
|
|
|
public static void Send<TKey, TValue>(this BaseBehaviour baseBehaviour, TKey key, TValue value)
|
|
{
|
|
MessageKit.Publish(key, value);
|
|
}
|
|
}
|
|
}
|