A
Supplier
responsible for providing a
Consumer
that
processes inbound responses.
Depending on the
GroupProperty.RESPONSE_THREAD_COUNT
it will return the appropriate response handler:
- a 'sync' response handler that doesn't offload to a different thread and
processes the response on the calling (IO) thread.
- a single threaded Packet Consumer that offloads the response processing a
ResponseThread/li>
- a multi threaded Packet Consumer that offloads the response processing
to a pool of ResponseThreads.
Having multiple threads processing responses improves performance and
stability of the throughput.
In case of asynchronous response processing, the response is put in the
responseQueue of the ResponseThread. Then the ResponseThread takes it from
this responseQueue and calls a
Consumer
for the actual processing.
The reason that the IO thread doesn't immediately deal with the response is that
dealing with the response and especially notifying the invocation future can be
very expensive.