File tree 1 file changed +43
-0
lines changed
1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
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 ;
You can’t perform that action at this time.
0 commit comments