1

I have lambda function which I invoke in a loop (boto3) asynchronous.

for obj in somelist:
    aws_lambda.invoke(FunctionName='lambda_name', 
                    InvocationType='Event', 
                    LogType='Tail',
                    Payload=bytes(obj))

It takes few seconds to process and I would like it to report back to my application.

How do I do that? I could send SNS message from lambda, there is also CloudWatch but it feels like there should be an easier way of doing it?

1 Answer 1

3

If you don't want your application to stop, SNS is really your best option. That, or emulating the basic feature of SNS by passing the functions an endpoint to call when they're done. Otherwise your options boil down to more or less logging state somewhere and polling for updates or executing a synchronous call in another thread.

Sign up to request clarification or add additional context in comments.

2 Comments

I've been looking at it yesterday and seems like SNS is the best option.
so invoke_async is not asynchronous? and you can't callback on the result?! That's crazy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.