org.redisson.config.Config.setEventLoopGroup()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(199)

本文整理了Java中org.redisson.config.Config.setEventLoopGroup()方法的一些代码示例,展示了Config.setEventLoopGroup()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.setEventLoopGroup()方法的具体详情如下:
包路径:org.redisson.config.Config
类名称:Config
方法名:setEventLoopGroup

Config.setEventLoopGroup介绍

[英]Use external EventLoopGroup. EventLoopGroup processes all Netty connection tied to Redis servers. Each EventLoopGroup creates own threads and each Redisson client creates own EventLoopGroup by default. So if there are multiple Redisson instances in same JVM it would be useful to share one EventLoopGroup among them.

Only io.netty.channel.epoll.EpollEventLoopGroup, io.netty.channel.kqueue.KQueueEventLoopGroupio.netty.channel.nio.NioEventLoopGroup can be used.

The caller is responsible for closing the EventLoopGroup.
[中]使用外部EventLoopGroup。EventLoopGroup处理所有绑定到Redis服务器的Netty连接。默认情况下,每个EventLoopGroup创建自己的线程,每个Redisson客户端创建自己的EventLoopGroup。因此,如果在同一JVM中有多个Redisson实例,那么在它们之间共享一个EventLoopGroup会很有用。
只有木卫一。内蒂。频道埃波尔。io的EpollEventLoopGroup。内蒂。频道排队。KQueueEventLoopGroupio。内蒂。频道尼奥。可以使用NioEventLoopGroup。
调用方负责关闭EventLoopGroup。

代码示例

代码示例来源:origin: redisson/redisson

setCodec(oldConf.getCodec());
setReferenceEnabled(oldConf.isReferenceEnabled());
setEventLoopGroup(oldConf.getEventLoopGroup());
setTransportMode(oldConf.getTransportMode());
setAddressResolverGroupFactory(oldConf.getAddressResolverGroupFactory());

代码示例来源:origin: redisson/redisson

setCodec(oldConf.getCodec());
setReferenceEnabled(oldConf.isReferenceEnabled());
setEventLoopGroup(oldConf.getEventLoopGroup());
setTransportMode(oldConf.getTransportMode());
setAddressResolverGroupFactory(oldConf.getAddressResolverGroupFactory());

代码示例来源:origin: kekingcn/spring-boot-klock-starter

@Bean(destroyMethod = "shutdown")
@ConditionalOnMissingBean
RedissonClient redisson() throws Exception {
  Config config = new Config();
  if(klockConfig.getClusterServer()!=null){
    config.useClusterServers().setPassword(klockConfig.getPassword())
        .addNodeAddress(klockConfig.getClusterServer().getNodeAddresses());
  }else {
    config.useSingleServer().setAddress(klockConfig.getAddress())
        .setDatabase(klockConfig.getDatabase())
        .setPassword(klockConfig.getPassword());
  }
  Codec codec=(Codec) ClassUtils.forName(klockConfig.getCodec(),ClassUtils.getDefaultClassLoader()).newInstance();
  config.setCodec(codec);
  config.setEventLoopGroup(new NioEventLoopGroup());
  return Redisson.create(config);
}

代码示例来源:origin: org.redisson/redisson

setCodec(oldConf.getCodec());
setReferenceEnabled(oldConf.isReferenceEnabled());
setEventLoopGroup(oldConf.getEventLoopGroup());
setTransportMode(oldConf.getTransportMode());
setAddressResolverGroupFactory(oldConf.getAddressResolverGroupFactory());

相关文章

微信公众号

最新文章

更多