- java.lang.Object
-
- io.netty5.channel.epoll.EpollHandler
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deregister(IoHandle handle)
Deregister aIoHandle
for IO.void
destroy()
Destroy theIoHandler
and free all its resources.boolean
isCompatible(Class<? extends IoHandle> handleType)
Returnstrue
if the given type is compatible with thisIoHandler
and so can be registered,false
otherwise.static IoHandlerFactory
newFactory()
Returns a newIoHandlerFactory
that createsEpollHandler
instances.static IoHandlerFactory
newFactory(int maxEvents, SelectStrategyFactory selectStrategyFactory)
Returns a newIoHandlerFactory
that createsEpollHandler
instances.void
prepareToDestroy()
Prepare to destroy thisIoHandler
.void
register(IoHandle handle)
Register aChannel
for IO.int
run(IoExecutionContext context)
Run the IO handled by thisIoHandler
.void
wakeup(boolean inEventLoop)
Wakeup theIoHandler
, which means if any operation blocks it should be unblocked and return as soon as possible.
-
-
-
Method Detail
-
newFactory
public static IoHandlerFactory newFactory()
Returns a newIoHandlerFactory
that createsEpollHandler
instances.
-
newFactory
public static IoHandlerFactory newFactory(int maxEvents, SelectStrategyFactory selectStrategyFactory)
Returns a newIoHandlerFactory
that createsEpollHandler
instances.
-
register
public final void register(IoHandle handle) throws Exception
Description copied from interface:IoHandler
Register aChannel
for IO.
-
deregister
public final void deregister(IoHandle handle) throws Exception
Description copied from interface:IoHandler
Deregister aIoHandle
for IO.- Specified by:
deregister
in interfaceIoHandler
- Parameters:
handle
- theIoHandle
to deregister..- Throws:
Exception
- thrown if an error happens during deregistration.
-
wakeup
public final void wakeup(boolean inEventLoop)
Description copied from interface:IoHandler
Wakeup theIoHandler
, which means if any operation blocks it should be unblocked and return as soon as possible.
-
run
public final int run(IoExecutionContext context)
Description copied from interface:IoHandler
Run the IO handled by thisIoHandler
. TheIoExecutionContext
should be used to ensure we not execute too long and so block the processing of other task that are scheduled on theEventLoop
. This is done by takingIoExecutionContext.delayNanos(long)
orIoExecutionContext.deadlineNanos()
into account.
-
prepareToDestroy
public void prepareToDestroy()
Description copied from interface:IoHandler
Prepare to destroy thisIoHandler
. This method will be called beforeIoHandler.destroy()
and may be called multiple times.- Specified by:
prepareToDestroy
in interfaceIoHandler
-
destroy
public final void destroy()
Description copied from interface:IoHandler
Destroy theIoHandler
and free all its resources.
-
isCompatible
public boolean isCompatible(Class<? extends IoHandle> handleType)
Description copied from interface:IoHandler
Returnstrue
if the given type is compatible with thisIoHandler
and so can be registered,false
otherwise.- Specified by:
isCompatible
in interfaceIoHandler
- Parameters:
handleType
- the type of theIoHandle
.- Returns:
- if compatible of not.
-
-