Issue #6728 - QUIC and HTTP/3

- Improved code comments.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2021-11-29 23:41:09 +01:00
parent 64296f76f1
commit 7e00e6a4bc
3 changed files with 10 additions and 0 deletions

View File

@ -75,6 +75,8 @@ public class ClientProtocolSession extends ProtocolSession
@Override
public Runnable getProducerTask()
{
// On the client, the contract is that applications should not block inside API callback methods,
// so a call to produce() should never block, and we can return a NON_BLOCKING producer task.
return producer;
}

View File

@ -71,6 +71,9 @@ public abstract class ProtocolSession extends ContainerLifeCycle
protected void produce()
{
// This method may be called concurrently, but the ExecutionStrategy guarantees
// that only one active thread is the producer thread for this ProtocolSession.
// On the server, this guarantees a "thread per active connection" model.
if (LOG.isDebugEnabled())
LOG.debug("processing {}", this);
strategy.produce();

View File

@ -67,6 +67,11 @@ public class ServerProtocolSession extends ProtocolSession
@Override
public Runnable getProducerTask()
{
// On the server, a call to produce() may process a stream which then parses a request,
// which then typically produces a blocking task that calls the application, which may
// be run by the ExecutionStrategy and therefore block the current thread.
// The producer task is always blocking to provide a "thread per active connection"
// model similar to what happens on the server with TCP networking.
return producer;
}