When a new http request comes in, will a new instance of sinatra be started, e.g. has sinatra to be initialized, or is just the method of a previous instance (the corresponding get/post method/route) of sinatra be called?
Thank you for any documentation links, i wasn’t able to find any.
It would also be interesting if that behavior is dependent on the deployment type – WEBrick/Passenger etc
A new class is created for every request. However, this is not done by Rack. This is a feature of Sinatra. If you want to dig into the details: The instance is not actually created with
Sinatra::Application.newbut withSinatra::Application.prototype.dup, seeSinatra::Base#callfor the code.