Skip to content

feat(network): adaptive EMA-based request timeout in http_client#540

Merged
Sadeequ merged 2 commits into
StellarFlow-Network:mainfrom
Chrisland58:feat/adaptive-request-timeout
Jun 28, 2026
Merged

feat(network): adaptive EMA-based request timeout in http_client#540
Sadeequ merged 2 commits into
StellarFlow-Network:mainfrom
Chrisland58:feat/adaptive-request-timeout

Conversation

@Chrisland58

Copy link
Copy Markdown
Contributor
  • Add AdaptiveTimeout class backed by RollingEMA from analytics/ema.py
  • Timeout = clamp(ema_latency * 3, 1s, 10s); falls back to 2.5s baseline before any samples are recorded
  • fetch_json, fetch_text, post_json each record round-trip latency into the module-level _adaptive_timeout instance so the window tunes itself across all outbound requests

Closes #495

- Add AdaptiveTimeout class backed by RollingEMA from analytics/ema.py
- Timeout = clamp(ema_latency * 3, 1s, 10s); falls back to 2.5s baseline
  before any samples are recorded
- fetch_json, fetch_text, post_json each record round-trip latency into
  the module-level _adaptive_timeout instance so the window tunes itself
  across all outbound requests

Closes StellarFlow-Network#495
@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Chrisland58 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Sadeequ Sadeequ merged commit 2bd3115 into StellarFlow-Network:main Jun 28, 2026
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.

🪓 Network-I/O | Dynamic Timeout Tuning Models for Global API Clients

2 participants