Skip to content

Commit fd52035

Browse files
authored
message_forwarding: Change call_slave_... functions to reduce repetition (#6321)
These functions were calling remote functions with rpc and session_id as unnamed parameters. Because the remote functions always gave these two parameters named, it required closures throughout the file to fix this inconsistency. This creates a lot of unnecessary code. Change the situation by making call_slave_... functions to call the functions using named parameters, and group the local and remote functions whenever a chain to_call_slave_... is initiated so it's easy to verify that the calls are correct. Most of the callers use the same name for both local and remote functions, but there are some interesting cases that can be easily seen now: pool_eject always uses the same remote function for 3 different types of members in the pool, previously 3 different closures were created and the code had to be careful with names to not confuse the ejected host from the ejectors. When starting a vm, the local function is start_on, while the remote function is start, the formers needs an additional host parameter, when compared to the latter. A lot of functions in message_forwarding look very regular, this may lead to a chance to further reduce glue code, or even generate the code?
2 parents 46dec4b + 2629a91 commit fd52035

File tree

3 files changed

+670
-948
lines changed

3 files changed

+670
-948
lines changed

0 commit comments

Comments
 (0)