Hello, I have 2 lambda functions, the first one is...
# help
b
Hello, I have 2 lambda functions, the first one is invoking the other, and waits for its response, then the first one pass the response to client, I am wondering if I can use SNS topics to publish from first one, and the second will response and publish again to first one, so I don't make the functions wait for each others (to decrease computing time). The question is how to make client waits while the function is terminated and invoked again by the other function to response?
m
You could consider a synchronous express step function for this. You do pay for state transitions, but you wouldn't pay for the wait time on the first Lambda function.
As for using SNS for this, I can't see how that would work unless you used web sockets or polling or something. I think express workflow step functions are what you want.
b
sounds good suggestion, maybe I need to compare costs before and after using step function, thank you @Matt Morgan