question

hack-comics avatar image
hack-comics asked

Blocking call on Lambda

Does amazon Lambda supports blocking call? or we are supposed to make async calls ?
alexa skills kit
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nick Gardner avatar image
Nick Gardner answered
Hi, It is possible to do blocking in Lambda, but the service is designed for async calls, so it is best to do that whenever possible. Cheers, Nick
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

John Schettino avatar image
John Schettino answered
What are you trying to accomplish? Node.js is always async, but there are any number of patterns for dealing with it - so there isn't anything you should need to do that you can't.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Kruse avatar image
Matt Kruse answered
There is no penalty for blocking calls in Lambda though, right? Each request is a new process, so there is nothing to "block", right? So, for simplicity in development, if there is a sync version of an API call, it's probably easier just to use it. There's no reason not to.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.