unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Blake Williams <blake@blakewilliams.me>
To: Eric Wong <e@80x24.org>
Cc: unicorn-public@yhbt.net
Subject: Re: [PATCH] Add rack.after_reply functionality
Date: Tue, 8 Dec 2020 18:48:25 -0500	[thread overview]
Message-ID: <E04F9E8A-02F6-42BC-831C-7AFF2B2F3615@blakewilliams.me> (raw)
In-Reply-To: <20201208224631.GA13148@dcvr>

> In the past, I've used response_body.close in middleware for
> similar things, and nowadays Rack::BodyProxy exists in rack, too.
> So I'm a little skeptical if this is actually needed, but it's
> probably too late to do anything about:

The first approach we took uses Rack::Events, which I believe is using
Rack::BodyProxy under the hood. We ran into an issue where all but
the last line of the response is written and the connection isn’t
actually closed yet when the callbacks are called.

> Citation(s) needed.  Also, are there any proposal(s) to get this
> into the Rack specification?

Not that I’m aware of. But I agree that it and early_hints could both be
good additions to the spec.

> I'll have to squash the following in, since an exception can be
> raised if a client truncates the request:

Good catch, sounds good to me.

> Everything else seems OK.  Thanks.

Awesome, thanks for the quick reply/feedback.

  reply	other threads:[~2020-12-08 23:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 21:47 [PATCH] Add rack.after_reply functionality Blake Williams
2020-12-08 22:46 ` Eric Wong
2020-12-08 23:48   ` Blake Williams [this message]
2020-12-09  9:43     ` Eric Wong
2020-12-09 14:58       ` Blake Williams
2020-12-09 22:18         ` Eric Wong
2020-12-09 23:44           ` Blake Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E04F9E8A-02F6-42BC-831C-7AFF2B2F3615@blakewilliams.me \
    --to=blake@blakewilliams.me \
    --cc=20201208224631.GA13148@dcvr \
    --cc=e@80x24.org \
    --cc=unicorn-public@yhbt.net \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).