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

⚡️ Respond to all queued fetch requests with single response #103

Merged
merged 2 commits into from
Sep 15, 2023

Conversation

randycoulman
Copy link
Collaborator

@randycoulman randycoulman commented Aug 30, 2023

NOTE: This is built on top of #102 and the base branch has been set accordingly. I will rebase on latest main before merging.

Describe the purpose of your pull request

When performing a fetch, queue up any new requests and then respond to all of the fetches with the result of the pending fetch.

This avoids making multiple consecutive fetch requests to the server.

Uses a technique I describe in [this blog post](https://blog.sequin.io/genserver-reply-dont-call-us-well-call-you/](https://blog.sequin.io/genserver-reply-dont-call-us-well-call-you/) along with a list of pending callers in the GenServer state.

Related issues (only if applicable)

https://trello.com/c/H6PU0SG0/15-only-one-config-json-download-at-a-time

Requirement checklist (only if applicable)

  • I have covered the applied changes with automated tests.
  • I have executed the full automated test set against my changes.
  • I have validated my changes against all supported platform versions.
  • I have read and accepted the contribution agreement.

@randycoulman randycoulman force-pushed the max-init-wait-time-seconds branch from fccb108 to 6c76bdd Compare September 12, 2023 03:37
Base automatically changed from max-init-wait-time-seconds to main September 15, 2023 01:02
When performing a fetch, queue up any new requests and then respond to all of the fetches with the result of the pending fetch.

This avoids making multiple consecutive fetch requests to the server.

Uses a technique I describe in [this blog post](https://blog.sequin.io/genserver-reply-dont-call-us-well-call-you/](https://blog.sequin.io/genserver-reply-dont-call-us-well-call-you/) along with a list of pending callers in the GenServer state.
Allow elapsed time to be equal to wait time instead of strictly greater than.
@randycoulman randycoulman force-pushed the only-one-config-json-download branch from 6ade075 to 9e5c418 Compare September 15, 2023 01:06
@codecov
Copy link

codecov bot commented Sep 15, 2023

Codecov Report

Patch coverage: 95.65% and project coverage change: -0.94% ⚠️

Comparison is base (0e9c030) 96.57% compared to head (191fb25) 95.64%.

❗ Current head 191fb25 differs from pull request most recent head 9e5c418. Consider uploading reports for the commit 9e5c418 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #103      +/-   ##
==========================================
- Coverage   96.57%   95.64%   -0.94%     
==========================================
  Files          28       31       +3     
  Lines         613      734     +121     
==========================================
+ Hits          592      702     +110     
- Misses         21       32      +11     
Files Changed Coverage Δ
lib/config_cat/config_fetcher.ex 98.87% <95.65%> (-1.13%) ⬇️

... and 22 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@randycoulman randycoulman merged commit 03a8f56 into main Sep 15, 2023
@randycoulman randycoulman deleted the only-one-config-json-download branch September 15, 2023 01:08
@kp-cat kp-cat mentioned this pull request Sep 20, 2023
4 tasks
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.

2 participants