Skip to content

Instantly share code, notes, and snippets.

@mosufy
Created June 5, 2021 01:51
Show Gist options
  • Save mosufy/2c9888e8b1fae717b1d918ca4f94fe1b to your computer and use it in GitHub Desktop.
Save mosufy/2c9888e8b1fae717b1d918ca4f94fe1b to your computer and use it in GitHub Desktop.
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