mtrudel/bandit

FunctionClauseError) no function clause matching in Bandit.HTTP1.Handler.handle_info/2

Closed this issue · 5 comments

phanmn commented

Hi, first of all thank you for your awesome library.

Yesterday, I saw this issue, can you please check it, many thanks!

deps/thousand_island/lib/thousand_island/handler.ex:5: Bandit.HTTP1.Handler.handle_info({#Reference<0.736885023.3819503617.224524>, :ok}, {%ThousandIsland.Socket{socket: #Port<0.1553>, transport_module: ThousandIsland.Transports.TCP, read_timeout: 60000, span: %ThousandIsland.Telemetry{span_name: :connection, telemetry_span_context: #Reference<0.736885023.3819438082.144351>, start_time: -576458810641083835, start_metadata: %{parent_telemetry_span_context: #Reference<0.736885023.3815768066.116439>, remote_address: {0, 0, 0, 0, 0, 65535, 2700, 10}, remote_port: 60086, telemetry_span_context: #Reference<0.736885023.3819438082.144351>}}}, %{handler_module: Bandit.HTTP1.Handler, http_1_enabled: true, http_2_enabled: true, opts: %{http_1: [], http_2: [], websocket: []}, plug:

This is cut from the same essential cloth as #218, #141, #84, mtrudel/thousand_island#83 and a few others. You aren't able to send messages to HTTP handler processes because Plug provides no way to surface them up to your application code.

Closing for hygiene. If the above pointers do NOT in fact answer the issue, please feel free to reopen!

Thanks for the issue!

phanmn commented

So it works normally right @mtrudel ?

Yep, this is 100% expected behaviour for the situation you're in. I have plans to revisit the plug interface to make things like this easier (and to accommodate gRPC and other more complex uses of http) but that's a large undertaking that will touch many projects beyond just Bandit and won't be coming until 2.0 or even later

phanmn commented

Many thanks