
io.dropwizard.redis.netty.DefaultEventExecutorGroupFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dropwizard-redis Show documentation
Show all versions of dropwizard-redis Show documentation
Provides easy integration for Dropwizard applications with Redis
The newest version!
package io.dropwizard.redis.netty;
import com.codahale.metrics.InstrumentedThreadFactory;
import com.codahale.metrics.MetricRegistry;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.netty.util.concurrent.DefaultEventExecutorGroup;
import io.netty.util.concurrent.DefaultThreadFactory;
import io.netty.util.concurrent.EventExecutorGroup;
import java.util.concurrent.ThreadFactory;
@JsonTypeName("default")
public class DefaultEventExecutorGroupFactory implements EventExecutorGroupFactory {
@Override
public EventExecutorGroup build(final int threadPoolSize, final String name, final MetricRegistry metrics) {
String poolName = String.format("%s-eventExecutorLoop", name);
final ThreadFactory threadFactory = new DefaultThreadFactory(poolName, true);
return new DefaultEventExecutorGroup(threadPoolSize, new InstrumentedThreadFactory(threadFactory, metrics, poolName));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy