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

simplify logic in queue's GetBroadcasts #301

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

Conversation

mbver
Copy link

@mbver mbver commented Jun 14, 2024

getting an item to broadcast based on priority of

  • transmits: the lower the better
  • msgLen: the longer the better
  • id: the higher the better
    starting from the front of queue check each item. if it is ok to be broadcasted. picked it and move on to the next. if it is not ok (length doesn't fit), still move on to the next. stop when there's no space for msgs or reach the end of queue.
    for all items that are picked, first delete them from the queue. then increase its transmits. if the item's transmit is over transmitLitmit, finish it. Else insert it back to the queue for the next round of GetBroadcast.
    The test is updated with variable message length and transmits.

Copy link

hashicorp-cla-app bot commented Jun 14, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@mbver
Copy link
Author

mbver commented Jun 22, 2024

hi @rboyer , could you please give me some feedbacks when you have time? thank you.

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.

1 participant