From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.141.43.5 with SMTP id v5cs212398rvj; Fri, 19 Feb 2010 21:02:01 -0800 (PST) Received-SPF: pass (google.com: domain of 3yGx_SwcJCgAhas.soxgmail.comrack-develgooglegroups.com@groups.bounces.google.com designates 10.115.102.40 as permitted sender) client-ip=10.115.102.40; Authentication-Results: mr.google.com; spf=pass (google.com: domain of 3yGx_SwcJCgAhas.soxgmail.comrack-develgooglegroups.com@groups.bounces.google.com designates 10.115.102.40 as permitted sender) smtp.mail=3yGx_SwcJCgAhas.soxgmail.comrack-develgooglegroups.com@groups.bounces.google.com; dkim=pass header.i=3yGx_SwcJCgAhas.soxgmail.comrack-develgooglegroups.com@groups.bounces.google.com Received: from mr.google.com ([10.115.102.40]) by 10.115.102.40 with SMTP id e40mr4906275wam.3.1266642121647 (num_hops = 1); Fri, 19 Feb 2010 21:02:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:x-beenthere:received:received:received :received:received-spf:received:mime-version:received:in-reply-to :references:date:message-id:subject:from:to :x-original-authentication-results:x-original-sender:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :x-thread-url:x-message-url:sender:list-subscribe:list-unsubscribe :content-type; bh=f10h00j9OUnydeESSna23crDz94XAjKbWNKIuwTWQSo=; b=zG4IIg9i2MRz4zYqSWNDcgirz3Z3cPivu0riW3RhDuXtGux1V7t+b5df69tUUNQ+T8 3qp9uHKwOEMML1cHXVJmZXpQfglKb1btGkvV72gVF8YXzfkjn4VhceODQ2PxqVHOH7G0 rVrn0dne0MyBFv/WPQ8ZqA8W0J++NNE7/vhhA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:mime-version:in-reply-to:references:date :message-id:subject:from:to:x-original-authentication-results :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:x-thread-url:x-message-url:sender :list-subscribe:list-unsubscribe:content-type; b=ptUHBKPYWfKiV0PtW4p4WUKy8+JS1DpKV+idzqXaBlWJDlsGTMODHLK+fQL8IzN7Vn KSGaYnmsjy5IqSIuONE8bNt76WqYu0rBqfXBYsYZ7/BfaDwwnZwH5bOiURMA/unmWBkA abULrBu4YI0GA3xu4N/xPb4D01lE/SuTpTZhM= Received: by 10.115.102.40 with SMTP id e40mr837151wam.3.1266642120408; Fri, 19 Feb 2010 21:02:00 -0800 (PST) X-BeenThere: rack-devel@googlegroups.com Received: by 10.114.215.3 with SMTP id n3ls907008wag.2.p; Fri, 19 Feb 2010 21:01:59 -0800 (PST) Received: by 10.114.18.16 with SMTP id 16mr2312697war.14.1266642118399; Fri, 19 Feb 2010 21:01:58 -0800 (PST) Received: by 10.114.18.16 with SMTP id 16mr2312696war.14.1266642118364; Fri, 19 Feb 2010 21:01:58 -0800 (PST) Return-Path: Received: from mail-pw0-f48.google.com (mail-pw0-f48.google.com [209.85.160.48]) by gmr-mx.google.com with ESMTP id 30si459864pxi.6.2010.02.19.21.01.57; Fri, 19 Feb 2010 21:01:57 -0800 (PST) Received-SPF: pass (google.com: domain of has.sox@gmail.com designates 209.85.160.48 as permitted sender) client-ip=209.85.160.48; Received: by mail-pw0-f48.google.com with SMTP id 6so768851pwi.35 for ; Fri, 19 Feb 2010 21:01:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.143.24.25 with SMTP id b25mr591413wfj.165.1266642117249; Fri, 19 Feb 2010 21:01:57 -0800 (PST) In-Reply-To: References: Date: Sat, 20 Feb 2010 16:01:57 +1100 Message-ID: <2fff50391002192101x18f84aafh426d8eabd8fbc14b@mail.gmail.com> Subject: Re: Use a different name instead of 'call' ? From: Daniel N To: rack-devel@googlegroups.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of has.sox@gmail.com designates 209.85.160.48 as permitted sender) smtp.mail=has.sox@gmail.com; dkim=pass (test mode) header.i=@gmail.com X-Original-Sender: has.sox@gmail.com Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: X-Thread-Url: http://groups.google.com/group/rack-devel/t/b1349cb02a9145d3 X-Message-Url: http://groups.google.com/group/rack-devel/msg/72d6f1609b7cd370 Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: multipart/alternative; boundary=001636e0a66c74ca2e04800119ad --001636e0a66c74ca2e04800119ad Content-Type: text/plain; charset=ISO-8859-1 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 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 > --001636e0a66c74ca2e04800119ad Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

The strength of rack is that it's a common stand= ard. =A0A rack application must respond to call, and receive an argument, t= he environment.

If you were to create middleware w= ith a different entry method, how would the calling middleware know what to= call? =A0The standard says to call the "call" method, thus, all = middleware know how to execute all middleware / applications. =A0By changin= g 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. =A0If a module you're includin= g defines a call method, then you'll need to divorce that from the actu= al middleware container.

Your middleware can be a very simple wrapper around you= r object, but in order to work the interface for rack must be preserved.

HTH
Daniel

On 20 February 2010 09:22, Guoliang Cao <gcao99@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 m= y
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<= br> this:

class MyMiddleware
=A0def rack_call_method
=A0 =A0 :my_rack_call
=A0end

=A0def my_rack_call env
=A0 =A0 # my middleware implementation goes here
=A0end
end

Thank you.

Cao

--001636e0a66c74ca2e04800119ad--