Skip to content

GODRIVER-2181 Use dedicated state constants for each topology type. #870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

matthewdale
Copy link
Collaborator

@matthewdale matthewdale commented Mar 10, 2022

GODRIVER-2181

Use dedicated constants for each of the connection, pool, poolGenerationMap, Server, and Topology types.

  • Add new state constants for the connection, poolGenerationMap, Server, and Topology types following the existing naming pattern of the pool state constants.
  • Remove any unused states for each type.
  • Rename the "state" field in each of the above types to state.

@matthewdale matthewdale changed the title GODRIVER-2181 Use different state constants for each topology type. GODRIVER-2181 Use dedicated state constants for each topology type. Mar 10, 2022
@matthewdale matthewdale marked this pull request as ready for review March 10, 2022 01:48
disconnecting
connected
connecting
initialized
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were connecting and initialized unused?

Copy link
Collaborator Author

@matthewdale matthewdale Mar 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connecting was only used by a Topology and initialized was only used by a connection. I reduced the set of constants for each specific type to only those referenced in the code and removed any unused constants.

Copy link
Contributor

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separating the state constants for connection, pool, Server, and Topology seems much easier to reason about. LGTM

@matthewdale matthewdale merged commit 001e550 into mongodb:master Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants