I'm using a library called sqs-consumer to process SQS messages. The library is expecting the message handler to look like:
handleMessage: (message, done) => {
// do some work with `message`
done();
}
On the other hand though I have async code
async function sendEmail() {
return await ...
}
Is there a good way to run the sendEmail
within handleMessage
, wait for it to finish, and then to call done
?