←back to thread

115 points nonfamous | 2 comments | | HN request time: 0s | source
Show context
ceejayoz ◴[] No.44567373[source]
I saw this come up on /r/aws a few days back.

This response seemed illuminating:

https://www.reddit.com/r/aws/comments/1lxfblk/comment/n2qww9...

> Looking at (this section)[https://will-o.co/gf4St6hrhY.png], it seems like you're trying to queue up an asyncronous task and then return a response. But when a Lambda handler returns a response, that's the end of execution. You can't return an HTTP response and then do more work after that in the same execution; it's just not a capability of the platform. This is documented behavior: "Your function runs until the handler returns a response, exits, or times out". After you return the object with the message, execution will immediately stop even if other tasks had been queued up.

replies(2): >>44567415 #>>44567675 #
1. xer0x ◴[] No.44567675[source]
There is a "post-invocation phase" for tidying up. It's not long, and it's enough for things like Datadog's metrics plugin to send off some numbers. Yet it will fail, if you have too many metrics. It's fuzzy.
replies(1): >>44567707 #
2. Scaevolus ◴[] No.44567707[source]
You only get that when you register extensions: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-...