macula_gateway_quic_server (macula v0.20.3)
View SourceQUIC Transport Layer Gen_Server
Handles all QUIC transport operations for the gateway: - Owns QUIC listener - Receives {quic, ...} events - Decodes protocol messages - Routes messages to gateway for business logic
This separation follows proper OTP design: - One process, one responsibility (transport vs routing) - Clean fault isolation (QUIC crashes don't crash gateway) - Proper supervision (supervisor can restart independently) - Testability (can test transport in isolation)
Summary
Functions
Handle synchronous calls. Set gateway PID for message routing
Handle asynchronous casts.
Handle QUIC event: new_stream (stream created by peer). Associates the stream with its parent connection to enable peer address lookup.
Initialize the QUIC server and start QUIC listener.
Set the gateway PID for message routing. Called by supervisor after both quic_server and gateway have started.
Start the QUIC server gen_server.
Cleanup on termination.
Functions
Handle synchronous calls. Set gateway PID for message routing
Handle asynchronous casts.
Handle QUIC event: new_stream (stream created by peer). Associates the stream with its parent connection to enable peer address lookup.
Initialize the QUIC server and start QUIC listener.
Set the gateway PID for message routing. Called by supervisor after both quic_server and gateway have started.
-spec start_link(Opts :: proplists:proplist()) -> {ok, pid()} | {error, term()}.
Start the QUIC server gen_server.
Cleanup on termination.