Skip to content

Commit 0e346b5

Browse files
committed
Update jslib-aws SQSClient's documentation to reflect new async syntax
1 parent bfc4b2b commit 0e346b5

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

src/data/markdown/docs/20 jslib/01 jslib/01 aws/00 SQSClient.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ excerpt: 'SQSClient allows interacting with the AWS Simple Queue Service (SQS)'
77

88
<BlockingAwsBlockquote />
99

10-
`SQSClient` interacts with the AWS Simple Queue Service (SQS). With it, the user can send messages to specified queues and list available queues in the current region. `SQSClient` operations are blocking.
10+
`SQSClient` interacts with the AWS Simple Queue Service (SQS).
11+
12+
With it, the user can send messages to specified queues and list available queues in the current region. `SQSClient` operations are blocking.
1113

1214
Both the dedicated `sqs.js` jslib bundle and the all-encompassing `aws.js` bundle include the `SQSClient`.
1315

@@ -46,15 +48,15 @@ const awsConfig = new AWSConfig({
4648
const sqs = new SQSClient(awsConfig)
4749
const testQueue = 'https://sqs.us-east-1.amazonaws.com/000000000/test-queue'
4850

49-
export default function () {
51+
export default async function () {
5052
// If our test queue does not exist, abort the execution.
51-
const queuesResponse = sqs.listQueues()
53+
const queuesResponse = await sqs.listQueues()
5254
if (queuesResponse.queueUrls.filter((q) => q === testQueue).length == 0) {
5355
exec.test.abort()
5456
}
5557

5658
// Send message to test queue
57-
sqs.sendMessage(testQueue, JSON.stringify({value: '123'}));
59+
await sqs.sendMessage(testQueue, JSON.stringify({value: '123'}));
5860
}
5961
```
6062

src/data/markdown/docs/20 jslib/01 jslib/01 aws/SQSClient/00 listQueues.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ excerpt: "SQSClient.listQueues retrieves a list of available Amazon SQS queues"
1616

1717
| Type | Description |
1818
| :---------------------------------------------------------- | :------------------------------------------------------------------------ |
19-
| `object` | An object with an `urls` property containing an array of queue URLs, and an optional `nextToken` containing a pagination token to include in the next request when relevant. |
19+
| `Promise<object>` | A Promise that fulfills with an object with an `urls` property containing an array of queue URLs, and an optional `nextToken` containing a pagination token to include in the next request when relevant. |
2020

2121
### Example
2222

@@ -37,17 +37,17 @@ const awsConfig = new AWSConfig({
3737
const sqs = new SQSClient(awsConfig)
3838
const testQueue = 'https://sqs.us-east-1.amazonaws.com/000000000/test-queue'
3939

40-
export default function () {
40+
export default async function () {
4141
// List all queues in the AWS account
42-
const queuesResponse = sqs.listQueues()
42+
const queuesResponse = await sqs.listQueues()
4343

4444
// If our test queue does not exist, abort the execution.
4545
if (queuesResponse.queueUrls.filter((q) => q === testQueue).length == 0) {
4646
exec.test.abort()
4747
}
4848

4949
// Send message to test queue
50-
sqs.sendMessage(testQueue, JSON.stringify({value: '123'}));
50+
await sqs.sendMessage(testQueue, JSON.stringify({value: '123'}));
5151
}
5252
```
5353

src/data/markdown/docs/20 jslib/01 jslib/01 aws/SQSClient/00 sendMessage.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ excerpt: "SQSClient.sendMessage sends a message to the specified Amazon SQS queu
1818

1919
| Type | Description |
2020
| :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21-
| `object` | The message that was sent, as an object containing an `id` string property holding the unique identifier for the message, and a `bodyMD5` string property holding the MD5 digest of the non-URL-encoded message body string. |
21+
| `Promise<object>` | A Promise that fulfills with the message that was sent, as an object containing an `id` string property holding the unique identifier for the message, and a `bodyMD5` string property holding the MD5 digest of the non-URL-encoded message body string. |
2222

2323
### Example
2424

@@ -39,15 +39,15 @@ const awsConfig = new AWSConfig({
3939
const sqs = new SQSClient(awsConfig)
4040
const testQueue = 'https://sqs.us-east-1.amazonaws.com/000000000/test-queue'
4141

42-
export default function () {
42+
export default async function () {
4343
// If our test queue does not exist, abort the execution.
44-
const queuesResponse = sqs.listQueues()
44+
const queuesResponse = await sqs.listQueues()
4545
if (queuesResponse.queueUrls.filter((q) => q === testQueue).length == 0) {
4646
exec.test.abort()
4747
}
4848

4949
// Send message to test queue
50-
sqs.sendMessage(testQueue, JSON.stringify({value: '123'}));
50+
await sqs.sendMessage(testQueue, JSON.stringify({value: '123'}));
5151
}
5252
```
5353

0 commit comments

Comments
 (0)