Library - Slim down the NodeManagerWorker
for node / flow controls
#6714
Labels
Component: API
ockam_api
hacktoberfest
Apply to issues you want contributors to help with
help wanted
Implementation: Rust
The purpose of the
NodeManagerWorker
is to be started as aWorker
on a node and receive requests to create entities on that node: inlets, outlets, secure channels, etc...This should be the only responsibility of the
NodeManagerWorker
:Requests
, with a specific pathNodeManager
NodeManager
and make aResponse
out of itExample
For example if we look at this dispatched request:
The implementation in the
NodeManagerWorker
is:It should actually be something like:
In the code above all the logic is handled by the
NodeManager
and theNodeManagerWorker
only deals with Request/Responses.Desired behavior
In this issue handle refactoring the following (each line corresponds to some paths in the
handle_request
method):Additional notes
You can follow the way
relays
are handled in this PR (here is the section on relays).You will notice that the
NodeManagerWorker
does not contain a direct reference to aNodeManager
but to anInMemoryNode
, which itself contains aNodeManager
.This intermediary layer is only required to monitor sessions for relays and portals. In most cases when you call
self.node_manager
inNodeManagerWorker
thenode_manager
can be dereferenced to aNodeManager
on which regular calls can be made: to list workers, get a credential etc....Note
Related epic: #6237
We love helping new contributors! ❤️
If you have questions or need help as you explore, please join us on Discord. If you're looking for other issues to contribute to, please checkout our good first issues.
The text was updated successfully, but these errors were encountered: