Hi,
Is it possible to launch fire and forget events inside a lambda function?
I’m using node.js and I’m wondering if the technique I used before using express.js it could work in lambda.
I mean this:
// code…
//Launch the function but don’t wait the callback and do other things…
fireAndForgetEvent(params, function(err, res) { console.log('fire and forget)});
// other things here…
db.findUser(userId, function(err, user){
console.log('the user:, user);
return lambdaHandlerCallback(err, user)
});
I suppose as soon as lambdaHandlerCallback is called Lambda should kill all code execution and maybe it does not work.
In that case, what should I do in order to launch logger or analytics functions that I don’t want to interrupt the core business code execution?
Thank you in advance