java.lang.Object
io.helidon.webserver.http1.Http1Connection
- All Implemented Interfaces:
InterruptableTask<Void>
,ServerConnection
,Runnable
,Callable<Void>
HTTP/1.1 server connection.
-
Method Details
-
canInterrupt
public boolean canInterrupt()Description copied from interface:InterruptableTask
Signals if a task can be interrupted at the time this method is called.- Specified by:
canInterrupt
in interfaceInterruptableTask<Void>
- Returns:
- outcome of interruptable test
-
handle
Description copied from interface:ServerConnection
Start handling the connection. Data is provided throughServerConnectionSelector.connection(io.helidon.webserver.ConnectionContext)
.- Specified by:
handle
in interfaceServerConnection
- Parameters:
limit
- that is responsible for maximal concurrent request limit, the connection implementation is responsible invoking each request within the limit'sLimitAlgorithm.invoke(java.util.concurrent.Callable)
- Throws:
InterruptedException
- to interrupt any waiting state and terminate this connection
-
handle
Description copied from interface:ServerConnection
Start handling the connection. Data is provided throughServerConnectionSelector.connection(io.helidon.webserver.ConnectionContext)
.- Specified by:
handle
in interfaceServerConnection
- Parameters:
requestSemaphore
- semaphore that is responsible for maximal concurrent request limit, the connection implementation is responsible for acquiring a permit from the semaphore for the duration of a request, and releasing it when the request ends; please be very careful, as this may lead to complete stop of the server if incorrectly implemented- Throws:
InterruptedException
- to interrupt any waiting state and terminate this connection
-
idleTime
Description copied from interface:ServerConnection
How long is this connection idle. This is a duration from the last request to now.- Specified by:
idleTime
in interfaceServerConnection
- Returns:
- idle duration
-
close
public void close(boolean interrupt) Description copied from interface:ServerConnection
Close a connection. This may be called during shutdown of the server, or when idle timeout is reached.- Specified by:
close
in interfaceServerConnection
- Parameters:
interrupt
- whether to interrupt in progress requests (always interrupts idle requests waiting for initial request data)
-