Specification
With the creation and integration of @matrixai/js-quic, the concept of a connection is now generic to forward and reverse initiated connections. This means, no matter who initiated the connection, streams can be created in either direction.
Previously the NodeConnectionManager only managed forward initiated connections. Now it should be able to handle reverse connections and add them to the connection map. This is essential for re-using connections efficiently.
The NodeConnection needs to be updated to be able to wrap QUICConnections coming out of the QUICServer. This will be a new async creation method. The cleanup logic will need to switch based on if it was a forward connection with a QUICClient or a reverse connection.
The QUICServer needs to be moved into and managed by the NodeConnectionManager. It's lifecycle will be fully managed. I don't know if we want to be able to DI it.
Reverse connections coming out of the QUICServer needs to be handled, wrapped in a NodeConnection and added into the connection map. There may be some complexities with locking here, that still needs to be prototyped.
All reverse stream events coming out of the QUICConnectons need to be handled by the RPCServer via a handleStream callback.
Additional context
Tasks
Specification
With the creation and integration of
@matrixai/js-quic, the concept of a connection is now generic toforwardandreverseinitiated connections. This means, no matter who initiated the connection, streams can be created in either direction.Previously the
NodeConnectionManageronly managedforwardinitiated connections. Now it should be able to handle reverse connections and add them to the connection map. This is essential for re-using connections efficiently.The
NodeConnectionneeds to be updated to be able to wrapQUICConnections coming out of theQUICServer. This will be a new async creation method. The cleanup logic will need to switch based on if it was a forward connection with aQUICClientor a reverse connection.The
QUICServerneeds to be moved into and managed by theNodeConnectionManager. It's lifecycle will be fully managed. I don't know if we want to be able to DI it.Reverse connections coming out of the
QUICServerneeds to be handled, wrapped in aNodeConnectionand added into the connection map. There may be some complexities with locking here, that still needs to be prototyped.All reverse stream events coming out of the
QUICConnectonsneed to be handled by theRPCServervia a handleStream callback.Additional context
js-quicintegration and Agent migration #525Tasks
NodeConnectionto wrap reverse createdQUICStreamsand handle clean up in all cases.QUICClientcan be optional and needs to be handled.QUICServerneeds to be moved and managed byNodeConnectionManagerQUICServerneeds to be handled and put into the connection map.QUICConnections needs to be handled by aRPCServervia ahandleStreamcallback.