Aetheria/Assets/Scripts/MagicOnion.Unity/ChannelExtensions.cs
hyperion51 a0c8dbee72 Initial Client/Server Communication
#1
Followed the MagicOnion quickstart guide, borrowing code from the chat sample app to get something working
2020-02-26 17:48:40 +00:00

19 lines
485 B
C#

using Grpc.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MagicOnion
{
public static class ChannelExtensions
{
/// <summary>
/// Safety way for subscribe streaming events.
/// </summary>
public static void RegisterStreamingSubscription(this Channel channel, IDisposable subscription)
{
channel.ShutdownToken.Register(() => subscription.Dispose());
}
}
}