Created
June 5, 2021 01:51
-
-
Save mosufy/2c9888e8b1fae717b1d918ca4f94fe1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SQS } from 'aws-sdk'; | |
export const sendQueue = (payload, options) => { | |
const sqs = new SQS(options); | |
sqs.sendMessage(payload, (error, data) => { | |
return new Promise((resolve, reject) => { | |
if (error) { | |
reject(new Error('Failed to send message')); | |
} else { | |
resolve('messageSent'); | |
} | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment