rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
* Why env.object_id is different in each middleware?
@ 2009-12-09 22:59 Iñaki Baz Castillo
  2009-12-09 23:15 ` Iñaki Baz Castillo
  0 siblings, 1 reply; 7+ messages in thread
From: Iñaki Baz Castillo @ 2009-12-09 22:59 UTC (permalink / raw)
  To: rack-devel

Hi, I've realized that env.object_id is different when inspecting it in each 
middleware or final application in a Rack builder. How is possible?

In my case I use this simple builder:

---------------------------------------
::Rack::Builder.new do

  use ::Clogger, ...

  map "/", &::MyApp.handle_request

end


class MyApp
  def self.handle_request
    proc do run Proc.new { |env|
      ::MyApp::Request.handle(env)
    } end
  end
end
---------------------------------------

If I check env.object_id into Clogger call method, and also into 
MyApp.ahndle_request, they have different values.

Since env is a hash I cannot understand why its object_id changes. Any 
explanatuion for it?
This explains that when I change env[XXX] into my final appplication 
MyApp.handle_request the change doesn't exist after calling
 resp = @app.call(env)
in the first middleware.

Thanks a lot.
-- 
Iñaki Baz Castillo <ibc@aliax.net>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-01-05 23:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-09 22:59 Why env.object_id is different in each middleware? Iñaki Baz Castillo
2009-12-09 23:15 ` Iñaki Baz Castillo
2010-01-04  0:50   ` Tim Carey-Smith
2010-01-04  0:58     ` Iñaki Baz Castillo
2010-01-04 19:44     ` Iñaki Baz Castillo
2010-01-05 20:57     ` Ryan Tomayko
2010-01-05 23:47       ` Iñaki Baz Castillo

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).