using StackExchange.Redis;
using System;

namespace VCommon.PubSub
{
    public class PubSubBase : IDisposable
    {
        protected readonly string ChannelName;
        internal readonly ConnectionMultiplexer Conn;

        public PubSubBase(string server, string channelName)
        {
            ChannelName = channelName;
            Conn = ConnectionMultiplexer.Connect(server);
        }

        public virtual void Dispose()
        {
            Conn?.Dispose();
        }
    }
}
