Consider Actor patterns within NetworkPeer. #208
Labels
Ciphernode
Related to the ciphernode package
enhancement
New feature or request
technical debt
Unaddressed shortcuts thay will become expensive problems later.
More and more it is becoming clear we need to have sophisticated behavior around our net package that is best managed using some of the techniques we have developed within our actor patterns we have used elsewhere.
Currently we have an actor
NetworkPeer
encapsulated by an actix actor that was being used to interface with the rest of the system.For historical reasons we avoided using actix actors here but it doesn't really make sense to maintain the complexity of channels when we use actix actors everywhere else within the codebase.
Evidence for why we need to do this can be seen in the emerging complexity around creating retry behaviour there we pass each channel down in a series of functions where it would be simpler to have this in it's own dialer actor and that actor can send messages back to a swarm actor. You could say we have created a quasi actor model system using channels for managing memory and ownership easily and allowing a more modular approach. This currently is fine as this is the main area of complexity here and is workable in it's current incarnation but when considering the other things we will almost certainly be doing here - we should switch out to conventional patterns that make good use of the message passing abstraction.
Other complex things we will likely need to do in the future:
These things wont scale well without decomposition into smaller modular parts which will be easier with the actor model.
The text was updated successfully, but these errors were encountered: