如何使nodejs cassandra驱动程序在Lambda中工作?

Lambda没有返回callback函数,如果我没有closures连接,但如果我closures连接第二次function不工作,我得到错误:“关机后关机不支持”代码:

client.connect(function(err) { console.log(err); const query = 'SELECT * FROM table LIMIT 1'; client.execute(query, [], {}, function(err, result) { if (err) { console.log("there was an err"); console.log(err); process.exit(); } else { client.shutdown(function() { callback(null, {}); }); } }); }); 

我知道这是它的工作方式: http : //docs.datastax.com/en/developer/nodejs-driver/latest/faq/#should-i-shut-down-the-pool-after-executing-一个问题

但有没有解决scheme来pipe理Lambda上的连接?

更多关于Lambda容器重用的信息: https : //aws.amazon.com/blogs/compute/container-reuse-in-lambda/