1. redis-go-clusterGo 實(shí)現(xiàn)的 Redis 集群客戶端

        聯(lián)合創(chuàng)作 · 2023-09-30 19:51

        redis-go-cluster 是基于 Redigo 實(shí)現(xiàn)的 Golang Redis 客戶端。redis-go-cluster 可以在本地緩存 slot 信息,并且當(dāng)集群修改的時(shí)候會(huì)自動(dòng)更新。此客戶端管理每個(gè)節(jié)點(diǎn)連接池,使用 goroutine 來盡可能的并發(fā)執(zhí)行,達(dá)到了高效,低延遲。

        redis-go-cluster 支持:

        • Most commands of keys, strings, lists, sets, sorted sets, hashes.

        • MGET/MSET

        • Pipelining

        不支持:

        • Cluster commands

        • Pub/Sub

        • Transaction

        • Lua script

        使用

        import "github.com/chasex/redis-go-cluster"
        
        cluster, err := redis.NewCluster(
            &redis.Options{
            StartNodes: []string{"127.0.0.1:7000", "127.0.0.1:7001", "127.0.0.1:7002"},
            ConnTimeout: 50 * time.Millisecond,
            ReadTimeout: 50 * time.Millisecond,
            WriteTimeout: 50 * time.Millisecond,
            KeepAlive: 16,
            AliveTime: 60 * time.Second,
            })
        瀏覽 19
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        評(píng)論
        圖片
        表情
        推薦
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
          
          

            1. 永久免费人成在线看不良视频 | 免费69国产精品成人无码视频 | 亚洲www视频 | 人人摸人操 | 啪啪啪免费观看网站 |