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

Can multiple clients share the same thread pool? #904

Open
cionz0 opened this issue May 19, 2020 · 0 comments
Open

Can multiple clients share the same thread pool? #904

cionz0 opened this issue May 19, 2020 · 0 comments

Comments

@cionz0
Copy link

cionz0 commented May 19, 2020

  • Python DynamoDB Lock version: 0.9.1
  • Python version: 3.6

Description

This is more a help request than an issue.
I'm using this package in an AWS Lambda function and such function has to be really responsive.
Since different keys have to be locked by different calls to my function, each time I:

  1. instantiate a client;
  2. request a lock on the desired key;
  3. of course, perform DB operations;
  4. release the lock;
  5. close the client.

The problem is that executing client.close() takes more or less 4 seconds, which is too much for the responsivity constraints I have to fulfill.

So, I was wondering whether I can have a large enough thread pool that I would like to pass as app_callback_executor parameter when instantiating the client so that I wouldn't need invoking client.close(), still avoiding to reach the maximum number of threads allowed for my lambda function (which, indeed, happens if I don't call close()).

Would it be possible?

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

No branches or pull requests

1 participant