Skip to content

Add per-connection shutdown handle - #202

Merged
abs0luty merged 1 commit into
masterfrom
feature/connection-shutdown
Nov 10, 2026
Merged

abs0luty merged 1 commit into
masterfrom
feature/connection-shutdown

Conversation

@abs0luty

@abs0luty abs0luty commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator
  • Adds ConnectionShutdown to the extensions of every request, so a handler can close the connection that dispatched it.
  • shutdown() drops the connection immediately, graceful_shutdown() delivers the in-flight response and then closes it.
  • Works for HTTP/1, HTTP/2, TLS, and Unix sockets. On HTTP/2 the connection carries many streams, so closing it closes all of them.
  • Keeps the handle usable from another task, which covers enforcing a deadline on a slow client.

Closes #29. The TCP keepalive part of that thread is unrelated and already shipped in 0.9.0 as accept::TcpConfigAcceptor.

Add `ConnectionShutdown` to request extensions so a handler can close the
connection that dispatched the request. `shutdown` drops the connection
immediately, while `graceful_shutdown` delivers the in-flight response and
then closes.

This covers the remaining part of the connection control request: handlers
can now enforce deadlines on slow clients without a server-wide shutdown.
@abs0luty
abs0luty merged commit c2c47f2 into master Nov 10, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Give more control on connection tasks

1 participant