aioboto3
aioboto3 copied to clipboard
SQS issue with aioboto3.session.client('SQS')
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.