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

In-flight request limiting #132

Merged
merged 9 commits into from
Jul 16, 2020
Merged

In-flight request limiting #132

merged 9 commits into from
Jul 16, 2020

Conversation

reivilibre
Copy link
Contributor

@reivilibre reivilibre commented Jul 8, 2020

Intended to provide a general increase in robustness/fault-tolerance, e.g. to address #117 .

@reivilibre reivilibre requested a review from a team July 8, 2020 14:48
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

looks good.

A word of advice: beware of overusing inheritance. It feels whizzy, but it's easy to end up with code that's hard to follow. in this case it might have been better to have a ConcurrencyLimiter object, where you can go:

async def dispatch_notification(self, n, device, context):
    with concurrency_limiter.limit():
        return await self._dispatch_notification_unlimited(n, device, context)

but I think this is fine.

@reivilibre
Copy link
Contributor Author

Thanks, I'll bear it in mind :)

@reivilibre reivilibre merged commit ad2ff36 into master Jul 16, 2020
@reivilibre reivilibre deleted the rei/concurrent_limit branch July 16, 2020 15:15
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