Skip to content
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

Refactor constants for sendTimeLimit and sendBufferSizeLimit to improve maintainability #33623

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

junhyeongkim2
Copy link

Summary:
This PR refactors the sendTimeLimit and sendBufferSizeLimit constants within the class to improve the overall code maintainability. The refactor involves moving magic numbers to well-defined constants and applying them consistently throughout the class. These changes make the code more readable and easier to modify in the future.

Changes:
Refactored sendTimeLimit and sendBufferSizeLimit:

  • Moved default values for sendTimeLimit and sendBufferSizeLimit into static final constants.
  • Default values for sendTimeLimit and sendBufferSizeLimit are now clearly defined using DEFAULT_SEND_TIME_LIMIT and DEFAULT_SEND_BUFFER_SIZE_LIMIT.
  • Ensured that these constants are applied consistently across the class.

Constants added:

  • DEFAULT_SEND_TIME_LIMIT: Default time limit for sending a message (set to 10 * 1000 milliseconds).
  • DEFAULT_SEND_BUFFER_SIZE_LIMIT: Default buffer size limit for sending a message (set to 512 * 1024 bytes).

Impact:

  • Maintainability: The use of constants for default values improves the maintainability of the code by providing clear, centralized definitions for these values. Future changes to the time or buffer limits can now be made easily in one place.
  • No functional changes: This is purely a refactor and does not alter the existing behavior of the code. The functionality remains the same as before.

This is my first time contributing to an open-source project, so there might be areas for improvement. I would greatly appreciate any feedback or suggestions. Thank you!

@pivotal-cla
Copy link

@junhyeongkim2 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 1, 2024
@pivotal-cla
Copy link

@junhyeongkim2 Thank you for signing the Contributor License Agreement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged or decided on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants