【问题标题】:Jedis pool for BinaryJedisClusterBinaryJedisCluster 的 Jedis 池
【发布时间】:2018-11-04 00:43:07
【问题描述】:

BinaryJedis 不是线程安全的,但它可以派生自 JedisPool getResource,它返回一个类型 JedisBinaryJedisCluster 线程安全吗?如果没有,是否有返回与BinaryJedisCluster 兼容的类型的连接池?我想在多线程环境中使用BinaryJedisCluster

【问题讨论】:

    标签: redis jedis


    【解决方案1】:

    BinaryJedisCluster 是线程安全的。它在内部使用JedisPool

    精心设计,

    • BinaryJedisCluster 使用 JedisClusterConnectionHandler
    • JedisClusterConnectionHandler 使用 JedisClusterInfoCache
    • JedisClusterInfoCache 使用 JedisPool

    所以,BinaryJedisClusterJedisPool 一样安全。

    【讨论】:

      猜你喜欢
      • 2018-09-06
      • 2016-12-10
      • 2016-02-03
      • 1970-01-01
      • 2017-11-18
      • 1970-01-01
      • 2016-05-06
      • 2015-09-09
      • 2018-12-10
      相关资源
      最近更新 更多