Spec support for connection close notification

Open
#542 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
clojure

Research direction

Start with the Ring specification and the issue’s examples of http-kit’s AsyncChannel and Aleph’s manifold streams. Compare how those systems expose connection closure and determine what a portable Ring-level mechanism would need to define. Done means reaching agreement on a proposed standard behavior and documenting its scope.

Written by the indexing model from the issue text.

Description

The Ring spec provides no mechanism for applications to be notified when a client connection is closed. This limitation is particularly relevant for long-lived streaming responses (e.g., Server-Sent Events), where the server may wish to release resources as soon as the client disconnects.

Currently the only way for the streaming server to discover the connection has been closed is to attempt a write to the output stream and catch the failure.

Some servers, such as http-kit (via its AsyncChannel) and Aleph (via manifold streams), already offer this functionality.

This issue is to open a discussion on whether and how the Ring spec could define a standard way for applications to observe the connection closure event.

Dominant language
Clojure
Stars
3.9k
Forks
528
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ring-clojure/ring

All issues in ring-clojure/ring

Similar issues

More Clojure issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.