Open
Description
Hi all,
I come from the dependency injector library, and recently I've been exploring another library to see if it could potentially replace dependency injector altogether.
I find it quite interesting, but I still have some doubts. For instance, how can I manage resource releases with this new library?
Let's consider a scenario where I have a client that needs to be released in a certain time (out of scope, raising an exception or at the end of a job to clean all resources):
def get_sqs_client_gen() -> Generator[SQSClient, None, None]:
client: Optional[SQSClient] = None
try:
client = get_sqs_client()
yield client
finally:
if client:
client.close()
Is there a provider within this library to handle such resources, or should I manually handle acquisition and release by passing it as a context manager?
Thank you for your support!
Metadata
Metadata
Assignees
Labels
No labels