K
K
Karina2018-01-05 15:20:08
ruby
Karina, 2018-01-05 15:20:08

Why do we need puma, rack?

I know that rack handles http requests - request, response - it's on it.
But why do you need a cougar? - the description says about multithreading, but if there is some kind of long task - you can just get by with sidekiq - do it in the background. But in the rails, the cougar is included, what she does is incomprehensible.
And what part of the application does the ruby ​​code? - is also not clear.
Thanks everyone for the replies.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-01-05
@iKapex

Roughly speaking, in general terms:
Rack is a library that provides an API for working with HTTP (basically all kinds of request and response handlers, other code callers, etc.).
Puma -- Web server. Puma listens to ports, handles connections, and so on. Like Nginx or Apache.
But there is a peculiarity - upon receiving a request, Puma will apply a Rack to it, which, in turn, will call the specified ruby ​​code, that is, the application itself (usually on some kind of frame, for example, a rail).
Something like this:
port 80, Puma --> Rack --> Application

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question