-
Notifications
You must be signed in to change notification settings - Fork 5
Description
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 QUICConnection
s 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
- 1. Update
NodeConnection
to wrap reverse createdQUICStreams
and handle clean up in all cases.QUICClient
can be optional and needs to be handled. - 2.
QUICServer
needs to be moved and managed byNodeConnectionManager
- 3. Reverse connections coming from the
QUICServer
needs to be handled and put into the connection map. - 4. Reverse streams from all
QUICConnection
s needs to be handled by aRPCServer
via ahandleStream
callback. - 5. Tests need to be expanded and updated to handle new behaviour