static async Task LockExecuteTestAsync() { const string channel = "message"; const string message = "hi there"; await redis.PublishAsync(channel, message); Console.WriteLine($" msg has been send channel: {channel} msg:{message} \t{DateTime.Now.ToLongTimeString()}"); }
public async Task PubSubTestAsync() { const string channel = "message"; const string message = "hi there"; await _redis.SubscribeAsync(channel, (chn, msg) => { Assert.Equal(channel, chn); Assert.Equal(message, msg); }); await _redis.PublishAsync(channel, message); }