elixir - Why Phoenix doesn't use Plug to start the server? -


liveforeverx on irc has answered original question , have modified question followup.

phoenix depends on plug many of function. however, when comes starting cowboy server, why doesn't phoenix start using plug's api in phoenix.endpoint.cowboyhandler.start_link? why start_link on ranch_listener_sup called instead?

is because of limitation of plug or because phoenix started way before plug's api got matured?

my original question:

how/where phoenix start cowboy?

reading plug docs, see start server, 1 has call

plug.adapters.cowboy.http/3 

however, grepping through phoenix app , phoenix source code, not see instance of call plug.adapters.cowboy.http/3. how/where phoenix start cowboy?

two reasons:

  1. to support websockets

  2. because phoenix starts server inside application supervision tree instead of running app inside cowboy


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -