org.apache.http.nio.reactor.IOReactor |
Known Indirect Subclasses |
HttpCore NIO is based on the Reactor pattern as described by Doug Lea. The purpose of I/O reactors is to react to I/O events and to dispatch event notifications to individual I/O sessions. The main idea of I/O reactor pattern is to break away from the one thread per connection model imposed by the classic blocking I/O model.
The IOReactor interface represents an abstract object implementing the Reactor pattern.
I/O reactors usually employ a small number of dispatch threads (often as few as one) to dispatch I/O event notifications to a much greater number (often as many as several thousands) of I/O sessions or connections. It is generally recommended to have one dispatch thread per CPU core.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Starts the reactor and initiates the dispatch of I/O event notifications
to the given
IOEventDispatch . | |||||||||||
Returns the current status of the reactor.
| |||||||||||
Initiates shutdown of the reactor and blocks approximately for the given
period of time in milliseconds waiting for the reactor to terminate all
active connections, to shut down itself and to release system resources
it currently holds.
| |||||||||||
Initiates shutdown of the reactor and blocks for a default period of
time waiting for the reactor to terminate all active connections, to shut
down itself and to release system resources it currently holds.
|
Starts the reactor and initiates the dispatch of I/O event notifications
to the given IOEventDispatch
.
eventDispatch | the I/O event dispatch. |
---|
IOException | in case of an I/O error. |
---|
Returns the current status of the reactor.
Initiates shutdown of the reactor and blocks approximately for the given period of time in milliseconds waiting for the reactor to terminate all active connections, to shut down itself and to release system resources it currently holds.
waitMs | wait time in milliseconds. |
---|
IOException | in case of an I/O error. |
---|
Initiates shutdown of the reactor and blocks for a default period of time waiting for the reactor to terminate all active connections, to shut down itself and to release system resources it currently holds. It is up to individual implementations to decide for how long this method can remain blocked.
IOException | in case of an I/O error. |
---|