Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Given two distinct lambda functions (A) and (B).

A client calls lambda (A), the call blocks until another client calls Lambda (B) and then returns. [Assuming within 1 minute]

Evidently, Lambda (B) could write a flag to a database, and Lambda (A) could poll on this flag until it's set, and then return. But this approach seems inelegant. Can someone suggest a better approach?

question from:https://stackoverflow.com/questions/65938154/inter-lambda-communication-on-aws-without-polling

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
255 views
Welcome To Ask or Share your Answers For Others

1 Answer

Ok,Lambda is server less/on the go compute. If you trigger a lambda and are polling for something else ,well, that is not what lambda is built for. We have SNS , SQS services which help us in avoiding polling and also help in decoupling +scaling.

May be you try something like this. 1.Let the event (which is triggering lambda A ) post to SQS. 2.Let the Lambda B be triggered. 3.Let Lambda B trigger lambda A and lambda A can get the info/event details from SQS.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...