Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

Refactor Session to remove code duplication #337

Merged
merged 1 commit into from
Aug 5, 2019

Conversation

tony-iqlusion
Copy link
Contributor

There was a lot of code duplication involved in just juggling and handing off various fields of ValidatorConfig.

Instead of that, this makes a copy of the ValidatorConfig at the time a given client thread is started, and passes is it through wholesale, storing it in Session.

Finally, Connection is made into a proper trait, allowing the generic parameter on Session to be removed, instead storing the session in Box<dyn Connection>.

This massively simplifies the involved code.

There was a lot of code duplication involved in just juggling and
handing off various fields of `ValidatorConfig`.

Instead of that, this makes a copy of the `ValidatorConfig` at the time
a given client thread is started, and passes is it through wholesale,
storing it in Session.

Finally, `Connection` is made into a proper trait, allowing the generic
parameter on `Session` to be removed, instead storing the session in
`Box<dyn Connection>`.

This massively simplifies the involved code.
@tarcieri tarcieri force-pushed the session-and-connection-refactor branch from f354446 to 9052e47 Compare August 5, 2019 22:49
@tarcieri tarcieri merged commit bbf5788 into master Aug 5, 2019
@tarcieri tarcieri deleted the session-and-connection-refactor branch August 5, 2019 23:16
@tony-iqlusion tony-iqlusion mentioned this pull request Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants