Package io.netty.channel
Interface IoHandlerContext
-
public interface IoHandlerContext
The context for anIoHandler
that is run by anThreadAwareExecutor
. All methods MUST be executed on theThreadAwareExecutor
thread (which meansThreadAwareExecutor.isExecutorThread(Thread)
(Thread)} must returntrue
).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canBlock()
Returnstrue
if blocking for IO is allowed or if we should try to do a non-blocking request for IO to be ready.long
deadlineNanos()
Returns the absolute point in time at which the next closest scheduled task should run or-1
if nothing is scheduled to run.long
delayNanos(long currentTimeNanos)
Returns the amount of time left until the scheduled task with the closest deadline should run.
-
-
-
Method Detail
-
canBlock
boolean canBlock()
Returnstrue
if blocking for IO is allowed or if we should try to do a non-blocking request for IO to be ready.- Returns:
true
if allowed,false
otherwise.
-
delayNanos
long delayNanos(long currentTimeNanos)
Returns the amount of time left until the scheduled task with the closest deadline should run.- Parameters:
currentTimeNanos
- the current nanos.- Returns:
- nanos
-
deadlineNanos
long deadlineNanos()
Returns the absolute point in time at which the next closest scheduled task should run or-1
if nothing is scheduled to run.- Returns:
- deadline.
-
-