hey guys, question, does SST facilitate calling a ...
# general
e
hey guys, question, does SST facilitate calling a lambda from another lambda? Or do I have to use aws-sdk directly?
t
hey we've recently moved to discord - see the following message: https://serverless-stack.slack.com/archives/C01JVDJQU2C/p1656001461847019 but yes you'd have to use aws-sdk directly. But calling lambda from a lambda is usually an antipattern
e
maybe you can bring me some light on this one... I have a semi-long-running method using puppeteer that may take more than the 30s that the API Gateway allows. My idea is to queue it and then fetch it (I don't want to use SNS). My plan was to create a record on a mongo, and when the task ends, then just update it's status. I've done this before by calling another lambda via API Gateway, so when it times out it doesn't matter because I just need the process to complete.
but if I could trigger the lambda in an async fashion, I would save that step
t
You should create a queue that triggers the long running function
and have the APIG publish to the queue
that makes it so failures and things will be retried
asyncInvoke like you have is OK but remember failures will just disappear
In my setup I actually have an event bus for things like this, I publish to the sst.Bus and anything can subscribe + process it
e
that sounds good, link to docs about it??
t
which part?
e
the event bus
t
https://docs.sst.dev/constructs/EventBus plus I did a video on this recently

https://www.youtube.com/watch?v=iMsPztMiFIk

e
thanks! I'll check it now
I've read the doc, it looks like it's exactly what I need. On which service does this rely?
oh event bridge, forget my previous message