Skip to content

Commit 98dc11f

Browse files
committed
feat(sqs-service): add sqs service
1 parent ca9e62b commit 98dc11f

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

src/services/aws/sqs_service.js

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* Convenience wrapper for AWS SQS (not meant to be instantiated directly).
3+
*
4+
* @class
5+
* @return {SQSService} a SQSService instance.
6+
*/
7+
class SQSService {
8+
constructor(baasClient, serviceName) {
9+
this.client = client;
10+
this.serviceName = serviceName;
11+
}
12+
13+
/**
14+
* Send a message of the output of previous stage to queue
15+
*
16+
* @return {Promise}
17+
*/
18+
send() {
19+
return this.client.executePipeline([
20+
{
21+
service: this.serviceName,
22+
action: 'send'
23+
}
24+
]);
25+
}
26+
27+
/**
28+
* Receive a message from queue
29+
*
30+
* @return {Promise}
31+
*/
32+
receive() {
33+
return this.client.executePipeline([
34+
{
35+
service: this.serviceName,
36+
action: 'receive'
37+
}
38+
]);
39+
}
40+
41+
}
42+
43+
export default SQSService;

0 commit comments

Comments
 (0)