rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: Guoliang Cao <gcao99@gmail.com>
To: Rack Development <rack-devel@googlegroups.com>
Subject: Re: Use a different name instead of 'call' ?
Date: Sun, 21 Feb 2010 07:50:38 -0800 (PST)	[thread overview]
Message-ID: <a350b286-f39a-4875-ad3c-c0204ec4ef30@f8g2000vba.googlegroups.com> (raw)
In-Reply-To: <2fff50391002192101x18f84aafh426d8eabd8fbc14b@mail.gmail.com>

Thank you fro the clear explanation.

- Cao

On Feb 20, 12:01 am, Daniel N <has....@gmail.com> wrote:
> Hi,
>
> The strength of rack is that it's a common standard.  A rack application
> must respond to call, and receive an argument, the environment.
>
> If you were to create middleware with a different entry method, how would
> the calling middleware know what to call?  The standard says to call the
> "call" method, thus, all middleware know how to execute all middleware /
> applications.  By changing the names of methods, you're not not able to call
> it.
>
> If your application absolutely _must_ implement a call method, then you'll
> need to wrap it.  If a module you're including defines a call method, then
> you'll need to divorce that from the actual middleware container.
>
> Your middleware can be a very simple wrapper around your object, but in
> order to work the interface for rack must be preserved.
>
> HTH
> Daniel
>
> On 20 February 2010 09:22, Guoliang Cao <gca...116@gmail.com> wrote:
>
> > Hi,
>
> > I'm relatively new here. Please forgive me if this has been asked
> > before.
>
> > I'm wondering if it is possible to name 'call' differently in my
> > middleware. Because 'call' is a relatively popular name and in case it
> > is already used in one of the modules I included, I have to create a
> > wrapper for my middleware. It'll be perfect if I can do something like
> > this:
>
> > class MyMiddleware
> >  def rack_call_method
> >     :my_rack_call
> >  end
>
> >  def my_rack_call env
> >     # my middleware implementation goes here
> >  end
> > end
>
> > Thank you.
>
> > Cao
>
>

      reply	other threads:[~2010-02-21 16:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-19 22:22 Use a different name instead of 'call' ? Guoliang Cao
2010-02-20  5:01 ` Daniel N
2010-02-21 15:50   ` Guoliang Cao [this message]

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-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

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

  git send-email \
    --in-reply-to=a350b286-f39a-4875-ad3c-c0204ec4ef30@f8g2000vba.googlegroups.com \
    --to=rack-devel@googlegroups.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).