Example usage for org.springframework.data.redis.connection.lettuce DefaultLettucePool destroy

List of usage examples for org.springframework.data.redis.connection.lettuce DefaultLettucePool destroy

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection.lettuce DefaultLettucePool destroy.

Prototype

@Override
    public void destroy() 

Source Link

Usage

From source file:org.springframework.data.redis.connection.lettuce.LettuceConnectionFactoryTests.java

@Test
public void testCreateFactoryWithPool() {
    DefaultLettucePool pool = new DefaultLettucePool(SettingsUtils.getHost(), SettingsUtils.getPort());
    pool.setClientResources(LettuceTestClientResources.getSharedClientResources());
    pool.afterPropertiesSet();/*from ww  w.  j  a v a 2 s  . c  o m*/
    LettuceConnectionFactory factory2 = new LettuceConnectionFactory(pool);
    factory2.setShutdownTimeout(0);
    factory2.afterPropertiesSet();

    ConnectionFactoryTracker.add(factory2);

    RedisConnection conn2 = factory2.getConnection();
    conn2.close();
    factory2.destroy();
    pool.destroy();
}