ruby - Is a global variable defined inside a Sinatra route shared between requests? - Stack Overflow

Uncategorized

ruby - Is a global variable defined inside a Sinatra route shared between requests? - Stack Overflow

URL: https://stackoverflow.com/questions/14388263/is-a-global-variable-defined-inside-a-sinatra-route-shared-between-requests
Type: link
Domain: stackoverflow.com

Excerpt: Say I've got: get '/' do $random = Random.rand() response.body = $random end If I have thousands of requests per second coming to /, will the $random be shared and 'leak' outside the context or...