Closed zampino closed 7 years ago
Thanks for catching this! I would be very happy to accept a Pull Request.
There's at least two projects wrapping elli in Elixir, but I don't know anything about development of a plug adapter except what you'll find on Google.
https://github.com/mme/ellihandler https://github.com/pigmej/exelli
Ok, yes I saw exelli. Anyway you have pr #89
I have been working on an alternative to plug. https://github.com/CrowdHailer/raxx which might be of interest on the subject of elixir adapters for elli.
Currently I have reached an impasse. Is it possible to get arbitrary messages out of the request processes mailbox? the equivalent of a handle_info on the request handler. I have been looking through the source code but can't see any way. I think i need something like the following in the chunk loop
chunk_loop(Socket) ->
receive
{tcp_closed, Socket} ->
{error, client_closed};
other ->
Mod.handle_info(other)
Around line https://github.com/knutin/elli/blob/master/src/elli_http.erl#L258 we have
Where Socket is a tuple of type
but the message being received is of the form
{ tcp_closed, X:socket()}
.The fix is easy, I can provide a pr.
I found this while sketching an Elixir Plug Adapter for Elli, does anyone knows if an "official" adapter is under development.
Cheers, Andrea