Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using StackExchange.Redis;
- namespace RedisPublisher
- {
- public class RedisPubSub
- {
- private readonly ConnectionMultiplexer _redis;
- private readonly ISubscriber _subscriber;
- public RedisPubSub(string server)
- {
- _redis = ConnectionMultiplexer.Connect(server);
- _subscriber = _redis.GetSubscriber();
- }
- public void Publish(string channelName, string message)
- {
- _subscriber.Publish(channelName, message);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement