Created
August 27, 2011 04:56
-
-
Save adorr/1175001 to your computer and use it in GitHub Desktop.
ruby session concurrency problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FoosController < ApplicationController | |
def zero | |
session[:zero] = "zero" | |
sleep 1 | |
render :text => "zero: #{session[:zero]}<br/>one: #{session[:one]}<br/>two: #{session[:two]} | |
<br/>three: #{session[:three]}" | |
end | |
def one | |
session[:one] = "one" | |
sleep 1 | |
render :text => "zero: #{session[:zero]}<br/>one: #{session[:one]}<br/>two: #{session[:two]} | |
<br/>three: #{session[:three]}" | |
end | |
def two | |
session[:two] = "two" | |
sleep 1 | |
render :text => "zero: #{session[:zero]}<br/>one: #{session[:one]}<br/>two: #{session[:two]} | |
<br/>three: #{session[:three]}" | |
end | |
def three | |
session[:three] = "three" | |
sleep 1 | |
render :text => "zero: #{session[:zero]}<br/>one: #{session[:one]}<br/>two: #{session[:two]} | |
<br/>three: #{session[:three]}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment