public
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/macournoyer/thin.git
Search Repo:
Make sure app.deferred?(env) is only called once per request
macournoyer (author)
Fri Apr 18 12:27:07 -0700 2008
commit  06439cf6a5ad3034ab7da732449e59e473b3a7c6
tree    2d63d526fdfd431044e5b478e438a51f5a2ec653
parent  c90f50f691e8325cd7a964b0a0d3b2052332a0ed
...
43
44
45
 
46
47
 
48
49
50
...
52
53
54
55
56
57
58
...
43
44
45
46
47
48
49
50
51
52
...
54
55
56
 
57
58
59
0
@@ -43,8 +43,10 @@
0
     # is ready to be processed.
0
     def process
0
       if threaded?
0
+ @request.threaded = true
0
         EventMachine.defer(method(:pre_process), method(:post_process))
0
       else
0
+ @request.threaded = false
0
         post_process(pre_process)
0
       end
0
     end
0
@@ -52,7 +54,6 @@
0
     def pre_process
0
       # Add client info to the request env
0
       @request.remote_address = remote_address
0
- @request.threaded = threaded?
0
       
0
       # Process the request calling the Rack adapter
0
       @app.call(@request.env)
...
71
72
73
 
 
74
75
 
76
77
78
...
71
72
73
74
75
76
 
77
78
79
80
0
@@ -71,8 +71,10 @@
0
   end
0
   
0
   it "should set request env as rack.multithread" do
0
+ EventMachine.should_receive(:defer)
0
+
0
     @connection.threaded = true
0
- @connection.pre_process
0
+ @connection.prprocess
0
     
0
     @connection.request.env["rack.multithread"].should == true
0
   end

Comments

    No one has commented yet.