crystalorb icon indicating copy to clipboard operation
crystalorb copied to clipboard

De-generalize Connection::send to simplify NetworkResource implementations

Open ErnWong opened this issue 2 years ago • 1 comments

See #7 for rationale.

This would allow us to get rid of TypeId uses in crystalorb-mock-network, for example.

ErnWong avatar Jul 14 '21 09:07 ErnWong

We can probably follow the similar approach to the way we de-generalized recv by having separate methods (e.g. send_snapshot, send_command). This might be slightly nicer than using an enum and a single send method because it is slightly weird that the enum would only be used for send and not for recv. The asymmetry between send and recv might give a bit more cognitive load when others try to read the code.

ErnWong avatar Jul 14 '21 09:07 ErnWong