raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / Atom feed
From: Ben Somers <somers.ben@gmail.com>
To: raindrops@librelist.org
Subject: Re: Raindrops::Middleware::Proxy claims to respond to #body when it does not?
Date: Thu, 17 May 2012 16:37:58 -0700
Message-ID: <CAO1NZAoyva-YOH92MdCfr7H14T+17nVo9ri3zVvDceQiBcbV6w@mail.gmail.com> (raw)
In-Reply-To: <20120517231806.GA16830@dcvr.yhbt.net>

>> Clearly the Raindrops::Middleware::Proxy has #respond_to? implemented
>> the way it is for a reason, but it seems awfully counterintuitive.
>
> I think I took the hint from Rack::BodyProxy.  The response needs to be
> proxied and call the #close method (to decrement the writer count).
> Proxying the body is the only way to get a Rack server to call #close
> (wrapping #each won't work because #to_path may be used instead)
>
> Without the proxy, raindrops wouldn't be able to instrument (userspace)
> time needed to write the response in a Rack-compliant fashion.

That is sensible.

Would it make sense to take a second hint from Rack::BodyProxy and add
a #method_missing to Raindrops::Middleware::Proxy that delegates to
its body? I think that's the answer to my concern about an unintuitive
#respond_to? method.

http://rubydoc.info/github/rack/rack/master/Rack/BodyProxy:method_missing

-ben

  reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-17 19:07 Ben Somers
2012-05-17 23:18 ` Eric Wong
2012-05-17 23:37   ` Ben Somers [this message]
2012-05-18  0:07     ` Eric Wong

Reply instructions:

You may reply publically 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://bogomips.org/raindrops/

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

  git send-email \
    --in-reply-to=CAO1NZAoyva-YOH92MdCfr7H14T+17nVo9ri3zVvDceQiBcbV6w@mail.gmail.com \
    --to=somers.ben@gmail.com \
    --cc=raindrops@librelist.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

raindrops RubyGem user+dev discussion/patches/pulls/bugs/help

Archives are clonable:
	git clone --mirror https://bogomips.org/raindrops-public
	git clone --mirror http://ou63pmih66umazou.onion/raindrops-public

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.raindrops
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.raindrops

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox