Skip to content

Optional sleep in http transport#755

Open
mxiao-cll wants to merge 1 commit intomainfrom
http
Open

Optional sleep in http transport#755
mxiao-cll wants to merge 1 commit intomainfrom
http

Conversation

@mxiao-cll
Copy link
Copy Markdown
Contributor

Add ability to sleep between http background execute cycles.

One of the use case is fallback transport, we may not want the fallback transport to go full speed on fetching values.

@mxiao-cll mxiao-cll requested a review from a team as a code owner April 29, 2026 01:25
@github-actions
Copy link
Copy Markdown
Contributor

👋 mxiao-cll, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

NPM Publishing labels 🏷️

🟢 This PR has valid version labels and will cause a patch bump.

Copy link
Copy Markdown
Contributor

@alejoberardino alejoberardino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be necessary, see #753 (review)

@dskloetc
Copy link
Copy Markdown
Contributor

Can you explain why the fallback transport would go full speed?

@mxiao-cll
Copy link
Copy Markdown
Contributor Author

Can you explain why the fallback transport would go full speed?

Fallback transport would go full speed because currently there is no difference between how a fallback and a primary is invoked. Let's say you have a 1 endpoint for rest and 1 endpoint with ws as primary and rest as fallback. The 2 rest endpoint invoked by the 2 endpoints will behave exactly the same.

Given how fallback is intended to be only kick in after primary fail, I think it is ok for it go a little bit slower to save some resources.

@dskloetc
Copy link
Copy Markdown
Contributor

Wouldn't the rate limiter make sure it doesn't go full speed?
The rate limiter affects all transports, not just the fallback. But as far as I can tell the same is true for your background sleep.

@mxiao-cll
Copy link
Copy Markdown
Contributor Author

Wouldn't the rate limiter make sure it doesn't go full speed? The rate limiter affects all transports, not just the fallback. But as far as I can tell the same is true for your background sleep.

Rate limiter would effect all transports, if the back-up transport is being used as a primary for a different feed, we don't want that to be effected. So I am looking for a lever that can adjust speed across different endpoints.

For background sleep this is specified on the endpoint level, so I can say for this endpoint sleep and for that don't sleep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants