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

Explicitly pass OpenMlsProvider to metadata functions #972

Merged
merged 3 commits into from
Aug 19, 2024

Conversation

insipx
Copy link
Contributor

@insipx insipx commented Aug 19, 2024

This will allow caller to decide whether to instantiate new connection or pass existing one. reduces the number of connections used for list_members.


Note all of the metadata methods for a group pull their own connection. These methods are generally for one specific thing, and are the sorts of methods that may generally be composed with alot of the same call (iterate over $X groups and get the group name for instance). if parallelized, these calls could possibly block the thread, since our SQLite pool is blocking. To mitigate this, we could 'reserve' a single SQLite connection, instantiate a XMTPOpenMlsProvider with it, and re-use it for all read-only metadata methods. This will reduce the amount of concurrent connections being pulled from the pool.

@insipx insipx changed the title Explicitly pass OpenMlsProvider to mutable metadata functions Explicitly pass OpenMlsProvider to metadata functions Aug 19, 2024
@insipx insipx marked this pull request as ready for review August 19, 2024 18:40
@insipx insipx requested a review from a team as a code owner August 19, 2024 18:40
@insipx insipx merged commit 74ff8be into main Aug 19, 2024
9 checks passed
@insipx insipx deleted the insipx/list-members branch August 19, 2024 19:06
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