public class IOService
extends java.lang.Object
Socket and
its implementations.| Constructor and Description |
|---|
IOService()
Creates one thread that will run all associated IO events
|
IOService(int numberOfThreads)
Creates
numberOfThreads threads that will run all
associated IO events |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Stops the event loop
|
Future<?> |
cancelAsync()
Stops the event loop asynchronously, useful when calling
this inside a
Callback. |
void |
post(Procedure block)
Executes the block of code in the event's loop Thread
|
Future<?> |
schedule(Procedure block,
long milliseconds)
Executes the block of code in the event's loop Thread, when
have passed some
milliseconds. |
public IOService()
public IOService(int numberOfThreads)
numberOfThreads threads that will run all
associated IO eventsnumberOfThreads - number of threadspublic void post(@NotNull
Procedure block)
block - block of code@NotNull public Future<?> schedule(@NotNull Procedure block, long milliseconds)
milliseconds.block - block of codemilliseconds - milliseconds of delay to execute the codeFuture for the scheduled taskpublic void cancel()