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

Adding Connection Pool functionality to pool workers #187

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

jhirschibar
Copy link

Description

Aiomultiprocess is exceptionally good at scaling network requests. However, the abstraction of tasks to queues scheduled amongst pool workers makes it impossible to enable connection pools for each worker in the current state. Using aiohttp's requests method results in a new session being created for every request, which degrades performance.

This PR nests each pool workers target .run() function within an async context manager that creates an aiohttp clientsession and passes the session into the tasks args.

The PR in its current state will need some clean up before it is ready for merge, but I wanted to submit as a WIP to see if a contribution such as this would even be considered.

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.

1 participant