Page 112 of 126 (2517 total posts)

April 2021

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

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

Source: stackoverflow.com

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

Tags: sinatra tips ruby stackoverflow state variables global