Skip to content

Can multiple clients share the same thread pool? #904

@cionz0

Description

@cionz0
  • 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions