Does Heroku support ActionController :: Live?

I have a Rails application hosted on Heroku and I want to add Server Sent Events functionality, but I cannot find any documentation or blog posts specific to Heroku.

As not all servers (for example, WEBrick) support ActionController :: Live I was wondering what the default server is on Heroku, and is it possible to configure the environment (for example, change the server) to support SSE.

Any further tips on how to use the server and how to configure it would be greatly appreciated.

+2
source share
2 answers

I think my answer is not so useful, but you can try.

Firstly:

create a Procfile in the root of the rails in the following contents:

web: bundle exec rails server puma -p $PORT -e $RACK_ENV 

then add to the gemfile:

 gem 'puma' 

In the above you can switch to thin, but consider the link below (and much more)

http://tenderlovemaking.com/2012/07/30/is-it-live.html

+1
source

Heroku will not necessarily be a problem here - it is an environment that allows your application to run (on Amazon EC2, I think)


Multithreaded servers

What you need to find is the server software that you use to run your application. Heroku basically takes your server stone and allows it to work with their processors and other computing power; so does their platform really play ball with the right server.

Are you really looking for multi-threaded servers that you can find here Are puma the only multi-threaded rails of 4 http servers?

Puma

Rainbows! supports several concurrency models, including multithreading

Zbatery - Rack HTTP server without a plug stuck in it

Phusion Passenger 4 supports multithreading since its beta.

Thin has a threaded mode, which can be enabled by transmitting - fixed or set the value threaded: true in the corresponding configuration file (for example, the exec thin start -threaded bundle)

Net :: HTTP :: Server , despite the lack of advertising, supports multithreading; very minimalist

0
source

Source: https://habr.com/ru/post/979568/


All Articles