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:
to support websockets
because phoenix starts server inside application supervision tree instead of running app inside cowboy
Comments
Post a Comment