staticRedisTest.cs 580 B

1234567891011121314151617181920
  1. using StackExchange.Redis;
  2. using System.Diagnostics;
  3. namespace rediswebapiTest
  4. {
  5. public static class staticRedisTest
  6. {
  7. public static void start()
  8. {
  9. var ret = ConnectionMultiplexer.Connect("127.0.0.1:6379,allowadmin=true");
  10. IDatabase database = ret.GetDatabase(0);
  11. ISubscriber subscriber = ret.GetSubscriber();
  12. subscriber.Subscribe("__keyevent@0__:expired", (channel, notificationType) =>
  13. {
  14. Debug.WriteLine(channel + "|" + notificationType);
  15. });
  16. }
  17. }
  18. }