aioboto3 icon indicating copy to clipboard operation
aioboto3 copied to clipboard

SQS issue with aioboto3.session.client('SQS')

Open Dz0n1Pr0 opened this issue 2 years ago • 0 comments

Hello, I have been working on a function that will log my responses asynchronously to SQS, but I am having trouble creating an SQS client that is open and not closed like how it is shown in the "with aioboto3.session.client("sqs") as sqs" example.

I tried following the ideas in this issue: https://github.com/terrycain/aioboto3/issues/233

I created a function

app.session = aioboto3.Session() app.sqs = None

async def get_sqs(): if app.sqs is None: app.sqs = await app.session.client("sqs") return app.sqs

but when I call the function I get an error TypeError: object ClientCreatorContext can't be used in 'await' expression on line app.sqs = await app.session.client("sqs")

Can you possibly assist me in resolving this issue?

I am using Quart for developing this API.

Dz0n1Pr0 avatar Oct 25 '22 11:10 Dz0n1Pr0