Implement cross-process coordination to reduce HTTP polling and stay within Azure rate limits#9
Draft
Implement cross-process coordination to reduce HTTP polling and stay within Azure rate limits#9
Conversation
…-process coordination Co-authored-by: MatthewSteeples <255971+MatthewSteeples@users.noreply.github.com>
…ror handling Co-authored-by: MatthewSteeples <255971+MatthewSteeples@users.noreply.github.com>
…dination Co-authored-by: MatthewSteeples <255971+MatthewSteeples@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Reduce the amount of HTTP polling required
Implement cross-process coordination to reduce HTTP polling and stay within Azure rate limits
Jun 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements a cross-process coordination system to address the rate limiting issue where multiple processes polling the Azure Scheduled Events endpoint can exceed the 5 requests/second per VM limit.
Problem
Currently, every process that uses this library queries the HTTP endpoint individually:
Solution
Implemented a file-based caching system with Named Mutex coordination:
Architecture
Azure.ScheduledEvents.GlobalLock) for cross-process coordinationKey Components
ScheduledEventsCoordinator: Manages lock acquisition, HTTP polling, and file caching%TEMP%\azure-scheduled-events-cache.jsonScheduledEventsClient: Now uses coordinator instead of direct HTTPBenefits
✅ Reduces HTTP requests from N processes to 1 per VM
✅ Stays within rate limits (5 requests/second per VM)
✅ Zero breaking changes - existing API unchanged
✅ Fault tolerant - automatic failover when coordinator process dies
✅ Production ready - comprehensive error handling and logging
Usage
No code changes required - the existing API works identically:
Testing
Added comprehensive test suite:
All tests pass successfully, demonstrating robust coordination behavior.
Fixes #8.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.