How long can I hold the AWAM lamba function before returning for alexa (echo amazon)?

This is just for demonstration, and Alexa (Amazon's echo) does not support us by clicking on it to speak randomly, so we want to remove the hack.

  • User speaks in Alexa
  • We have our lambda that takes an action, and then hopefully sleep and wait for an API response that won't happen until we do something
  • Then we can send a response from another user
  • Lambda now returns text

Thus, we are trying to simulate two-way communication through Alexa.

Should I worry that Alexa will choose the time? If so, how long will it take? Will my Lambda timeout also (I assume I can just sleep in this code or hang on a remote call)?

+5
source share
2 answers

The response timeout is set by your AWMS Lambda backend. If you do not configure it by default, the default timeout is 3 seconds. Rules for setting the timeout are described in the Lambda FAQ :

Q: How long can the AWS Lambda function run?

All calls made to AWS Lambda must be completed within 300 seconds. The default timeout is 3 seconds, but you can set the timeout to any value from 1 to 300 seconds.

If your response processing takes a long time to create a noticeable expectation, the Echo device will instantly start its light ring to indicate that work is in progress. This will continue, blocking any other interaction with the Echo device until a response is returned or the support Lambda function reaches its timeout limit.

+6
source

I'm not sure what the maximum timeout for Alexa is, but I just tried 60 seconds and it seemed to work. Lambda allows you to set the request timeout in the Configuration / AdvancedSettings section. There is a field for several minutes, but never tried to increase the wait time for more than 10 seconds.

Lambda console image

+2
source

Source: https://habr.com/ru/post/1246281/


All Articles