Constructor and Description |
---|
ReactorImpl(ManagedContext context) |
Modifier and Type | Method and Description |
---|---|
void |
addPollable(Pollable pollable,
LoopHandler handler)
Add a new Pollable to this Reactor.
|
void |
addTimer(long initialDelay,
int numIterations,
LoopHandler handler)
Add a new ReactorTimer to this Reactor.
|
void |
cancel(LoopHandler handler)
Cancel an existing Pollable or ReactorTimer and remove the corresponding
LoopHandler from executing.
|
void |
run() |
void |
start()
Start the reactor.
|
void |
stop()
Stop the reactor.
|
public ReactorImpl(ManagedContext context)
public void addPollable(Pollable pollable, LoopHandler handler)
Reactor
This method is not thread-safe, and should only be done from inside the LoopHandler when invoked by the Reactor on its own thread.
addPollable
in interface Reactor
pollable
- The Pollable with the socket to pollhandler
- The loop handlerpublic void addTimer(long initialDelay, int numIterations, LoopHandler handler)
Reactor
This method is not thread-safe, and should only be done from inside the LoopHandler when invoked by the Reactor on its own thread.
public void cancel(LoopHandler handler)
Reactor
This method is not thread-safe, and should only be done from inside the LoopHandler when invoked by the Reactor on its own thread.
public void start()
Reactor
public void stop()
Reactor
Copyright © 2019. All rights reserved.