Search in sources :

Example 1 with EmptyStatefulRedisConnection

use of io.lettuce.core.EmptyStatefulRedisConnection in project lettuce-core by lettuce-io.

the class GenericConnectionPoolBenchmark method setup.

@Setup
public void setup() {
    GenericObjectPoolConfig config = new GenericObjectPoolConfig();
    config.setMinIdle(0);
    config.setMaxIdle(20);
    config.setMaxTotal(20);
    pool = ConnectionPoolSupport.createGenericObjectPool(() -> new EmptyStatefulRedisConnection(EmptyRedisChannelWriter.INSTANCE), config);
}
Also used : EmptyStatefulRedisConnection(io.lettuce.core.EmptyStatefulRedisConnection) GenericObjectPoolConfig(org.apache.commons.pool2.impl.GenericObjectPoolConfig)

Example 2 with EmptyStatefulRedisConnection

use of io.lettuce.core.EmptyStatefulRedisConnection in project lettuce-core by lettuce-io.

the class AsyncConnectionPoolBenchmark method setup.

@Setup
public void setup() {
    BoundedPoolConfig config = BoundedPoolConfig.builder().minIdle(0).maxIdle(20).maxTotal(20).build();
    pool = AsyncConnectionPoolSupport.createBoundedObjectPool(() -> CompletableFuture.completedFuture(new EmptyStatefulRedisConnection(EmptyRedisChannelWriter.INSTANCE)), config);
}
Also used : EmptyStatefulRedisConnection(io.lettuce.core.EmptyStatefulRedisConnection)

Aggregations

EmptyStatefulRedisConnection (io.lettuce.core.EmptyStatefulRedisConnection)2 GenericObjectPoolConfig (org.apache.commons.pool2.impl.GenericObjectPoolConfig)1