Heyo! You've really helped me understand how to use ranch in Elixir, thanks a ton.
I have one suggestion for you about how you set up your port listening process. Instead of wrapping the Ranch listener in your own GenServer, you can instead use :ranch.child_spec/5 in your application module to setup the listener. Like so:
Heyo! You've really helped me understand how to use ranch in Elixir, thanks a ton.
I have one suggestion for you about how you set up your port listening process. Instead of wrapping the Ranch listener in your own
GenServer
, you can instead use:ranch.child_spec/5
in your application module to setup the listener. Like so:Now all you have to do is write the handler module :) Notice that
:ranch.child_spec/5
takes the same arguments as:ranch.start_listener/5
.