Skip to content

Add bounded_gather helper for concurrency-limited API calls - #117

Merged
PenguinBoi12 merged 1 commit into
mainfrom
api-bounded_gather
Jul 23, 2026
Merged

Add bounded_gather helper for concurrency-limited API calls#117
PenguinBoi12 merged 1 commit into
mainfrom
api-bounded_gather

Conversation

@PenguinBoi12

Copy link
Copy Markdown
Contributor

Description

Adds bounded_gather to matrix/api.py, following up on #86's review comment.

bounded_gather runs an iterable of coroutines concurrently, capped by a semaphore, so sending out many API calls (e.g. broadcasting to many rooms) doesn't fire everything at once against a shared rate limit.

Type of Change

  • Feature
  • Refactor
  • Bug fix
  • Documentation
  • Other: ___

Pre-merge Checklist

  • Run tests: pytest
  • Run type check: mypy
  • Run formatting: black .

@chrisdedman chrisdedman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@PenguinBoi12
PenguinBoi12 merged commit ea1220b into main Jul 23, 2026
4 checks passed
@PenguinBoi12
PenguinBoi12 deleted the api-bounded_gather branch July 23, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants