# synccache **Repository Path**: evlon/synccache ## Basic Information - **Project Name**: synccache - **Description**: It is a cache that use redis sub/pub to sync object beteen redis and memory. - **Primary Language**: C# - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-09-14 - **Last Updated**: 2022-06-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # synccache It is a cache that use redis sub/pub to sync object beteen redis and memory. ```csharp class Program { static void Main(string[] args) { Console.WriteLine("你运行程序后,可以直接在Redis中修改memcache#msg的值,然后在这里看到立即更新后的值。"); /* 127.0.0.1:63791> keys * 1) "memcache#sample#msg" 127.0.0.1:63791> get "memcache#sample#msg" "\"hello world\"" 127.0.0.1:63791> set "memcache#sample#msg" "\"nihao\"" OK */ var syncCache = new SyncCache.Mem4RedisCache("sample", 24000); while (true) { var msg = syncCache.GetValue("sample#msg",()=>"hello world"); Console.WriteLine(msg); Thread.Sleep(200); } } } ```