we now handle local cmds first, with higher priority, keeping latency for these low
This pull request primarily involves refactoring of the SwarmCmd structure into two separate structures: LocalSwarmCmd and NetworkSwarmCmd in the sn_networking/src/driver.rs and sn_networking/src/lib.rs files. This modification is aimed at separating local commands from network commands, improving the organization and readability of the code.
Here are the most important changes:
Refactoring of SwarmCmd:
sn_networking/src/driver.rs: The SwarmCmd structure has been replaced with LocalSwarmCmd and NetworkSwarmCmd structures. This change is reflected in the import statements, function parameters, and function calls throughout the file. [1][2][3][4][5][6][7][8]
These changes enhance the separation of concerns in the codebase, making it easier to manage and understand the different types of commands that can be sent in the network.
As laid out nicely here https://github.com/libp2p/rust-libp2p/blob/master/docs/coding-guidelines.md#prioritize-local-work-over-new-work-from-a-remote
we now handle local cmds first, with higher priority, keeping latency for these low
This pull request primarily involves refactoring of the
SwarmCmd
structure into two separate structures:LocalSwarmCmd
andNetworkSwarmCmd
in thesn_networking/src/driver.rs
andsn_networking/src/lib.rs
files. This modification is aimed at separating local commands from network commands, improving the organization and readability of the code.Here are the most important changes:
Refactoring of
SwarmCmd
:sn_networking/src/driver.rs
: TheSwarmCmd
structure has been replaced withLocalSwarmCmd
andNetworkSwarmCmd
structures. This change is reflected in the import statements, function parameters, and function calls throughout the file. [1] [2] [3] [4] [5] [6] [7] [8]sn_networking/src/event/swarm.rs
: TheSwarmCmd
structure has been replaced withLocalSwarmCmd
in the import statements and function calls. [1] [2]sn_networking/src/lib.rs
: TheSwarmCmd
structure has been replaced withLocalSwarmCmd
andNetworkSwarmCmd
structures. This change is reflected in the import statements, function parameters, and function calls throughout the file. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]These changes enhance the separation of concerns in the codebase, making it easier to manage and understand the different types of commands that can be sent in the network.