elegant-pager-5412
04/27/2021, 2:45 PMCallbackFunction
to define lambdas, there is a major issue with the scoping. The generated code is exporting the entire callback exports.handler = __f0
. While it should be fine, it leaves no room for us to open sockets/connection in the “global” lambda scope, but only in the invoked code which is a bad practice.
Is there any way to solve this?
Essentially, I want something like:
exports.handle = __f0;
// Some connection code:
AWSLambda.init({...}) // sentry
function __f0(...) {
// ...
}
callbackFactory
property instead of the callback
one and make that callback return another callback