ring-clojure / ring-clojure/ring

Spec support for connection close notification

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

Nobody has claimed this yet.

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

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.

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.