Check if Epoll is avaible when construct EpollEventLoopGroup
Motivation: We should call Epoll.ensureAvailability() when init EpollEventLoopGroup to fail fast and with a proper exception. Modifications: Call Epoll.ensureAvailability() during EpollEventLoopGroup init. Result: Fail fast if epoll is not availability (for whatever reason).
This commit is contained in:
parent
8dda984afe
commit
81735c2535
@ -98,21 +98,25 @@ public final class EpollEventLoopGroup extends MultithreadEventLoopGroup {
|
||||
public EpollEventLoopGroup(int nThreads, ThreadFactory threadFactory, int maxEventsAtOnce,
|
||||
SelectStrategyFactory selectStrategyFactory) {
|
||||
super(nThreads, threadFactory, maxEventsAtOnce, selectStrategyFactory, RejectedExecutionHandlers.reject());
|
||||
Epoll.ensureAvailability();
|
||||
}
|
||||
|
||||
public EpollEventLoopGroup(int nThreads, Executor executor, SelectStrategyFactory selectStrategyFactory) {
|
||||
super(nThreads, executor, 0, selectStrategyFactory, RejectedExecutionHandlers.reject());
|
||||
Epoll.ensureAvailability();
|
||||
}
|
||||
|
||||
public EpollEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory,
|
||||
SelectStrategyFactory selectStrategyFactory) {
|
||||
super(nThreads, executor, chooserFactory, 0, selectStrategyFactory, RejectedExecutionHandlers.reject());
|
||||
Epoll.ensureAvailability();
|
||||
}
|
||||
|
||||
public EpollEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory,
|
||||
SelectStrategyFactory selectStrategyFactory,
|
||||
RejectedExecutionHandler rejectedExecutionHandler) {
|
||||
super(nThreads, executor, chooserFactory, 0, selectStrategyFactory, rejectedExecutionHandler);
|
||||
Epoll.ensureAvailability();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user