Top Description Methods
org.apache.hc.core5.reactor

public Interface IOReactor

extends ModalCloseable
Known Direct Subinterfaces
org.apache.hc.core5.reactor.IOReactorService
Known Direct Implementers
org.apache.hc.core5.reactor.MultiCoreIOReactor, org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor
Imports
org.apache.hc.core5.io.CloseMode, .ModalCloseable, org.apache.hc.core5.util.TimeValue

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.

Since
4.0

Method Summary

Modifier and TypeMethod and Description
public void
awaitShutdown(TimeValue
wait time.
waitTime
)

Blocks for the given period of time in milliseconds awaiting the completion of the reactor shutdown.

public void
close(CloseMode
How to close the receiver.
closeMode
)

Redeclares org.apache.hc.core5.io.ModalCloseable.close.

Shuts down the I/O reactor either gracefully or immediately.
public IOReactorStatus

Returns:

reactor status.
getStatus
()

Returns the current status of the reactor.

public void
initiateShutdown()

Initiates shutdown of the reactor without blocking.

Method Detail

awaitShutdownback to summary
public void awaitShutdown(TimeValue waitTime) throws InterruptedException

Blocks for the given period of time in milliseconds awaiting the completion of the reactor shutdown.

Parameters
waitTime:TimeValue

wait time.

Since
5.0
closeback to summary
public void close(CloseMode closeMode)

Redeclares org.apache.hc.core5.io.ModalCloseable.close.

Shuts down the I/O reactor either gracefully or immediately. During graceful shutdown individual I/O sessions should be informed about imminent termination and be given a grace period to complete the ongoing I/O sessions. During immediate shutdown all ongoing I/O sessions get aborted immediately.

Parameters
closeMode:CloseMode

Doc from org.apache.hc.core5.io.ModalCloseable.close.

How to close the receiver.

Annotations
@Override
getStatusback to summary
public IOReactorStatus getStatus()

Returns the current status of the reactor.

Returns:IOReactorStatus

reactor status.

initiateShutdownback to summary
public void initiateShutdown()

Initiates shutdown of the reactor without blocking. The reactor is expected to terminate all active connections, to shut down itself and to release system resources it currently holds

Since
5.0