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

LeakyBucketExecutionPolicy support for requests context #672

Merged
merged 1 commit into from
Oct 14, 2021

Conversation

clement911
Copy link
Collaborator

This is a non breaking change.
A new optional parameter getRequestContext can be supplied when constructing a LeakyBucketExecutionPolicy.

It serves to indicate whether the current context is Foreground or Background. The policy will prioritize foreground requests and run them first.

For example, if a user is waiting on the request (loading a page showing response results for example), you would want to prioritize this request over competing requests that might be running in the background (to run some jobs for example).
(In this scenario, you could for example inspect if there is an ambient HttpContext to determine whether the request is Foreground or Background)

@nozzlegear nozzlegear merged commit f9a7d48 into nozzlegear:master Oct 14, 2021
@nozzlegear
Copy link
Owner

Published in v5.14.0 on nuget!

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.

None yet

2 participants