Is Sinatra multi threaded?

后端 未结 5 1041
忘掉有多难
忘掉有多难 2020-11-30 19:57

Is Sinatra multi-threaded? I read else where that \"sinatra is multi-threaded by default\", what does that imply?

Consider this example

get \"/multi         


        
5条回答
  •  -上瘾入骨i
    2020-11-30 20:43

    Thought I might elaborate for people who come across this. Sinatra includes this little chunk of code:

       server.threaded = settings.threaded if server.respond_to? :threaded=    
    

    Sinatra will detect what gem you have installed for a webserver (aka, thin, puma, whatever.) and if it responds to "threaded" will set it to be threaded if requested. Neat.

提交回复
热议问题