generated from mintlify/starter
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Qstash-js: Add pause resume schedule & queue docs and timeout docs
* feat: add pause resume schedule & queue docs and timeout docs the changes reflect the last two changes in upstash/qstash-js#109 * feat: add qstash-js messages deleteMany & deletAll examples the changes we document are in: - PR upstash/qstash-js#114 - commit upstash/qstash-js@dd93920 * fix: update according to reviews
- Loading branch information
Showing
6 changed files
with
117 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: Queues | ||
--- | ||
|
||
#### Create a queue with parallelism 2 | ||
|
||
```typescript | ||
import { Client } from "@upstash/qstash"; | ||
const client = new Client({ token: "<QSTASH_TOKEN>" }); | ||
|
||
const queueName = "upstash-queue"; | ||
await client.queue({ queueName }).upsert({ parallelism: 2 }); | ||
|
||
const queueDetails = await client.queue({ queueName }).get(); | ||
``` | ||
|
||
#### Delete Queue | ||
|
||
```typescript | ||
import { Client } from "@upstash/qstash"; | ||
const client = new Client({ token: "<QSTASH_TOKEN>" }); | ||
|
||
const queueName = "upstash-queue"; | ||
await client.queue({ queueName: queueName }).delete(); | ||
``` | ||
|
||
#### Pause/Resume a queue | ||
|
||
```typescript | ||
import { Client } from "@upstash/qstash"; | ||
const client = new Client({ token: "<QSTASH_TOKEN>" }); | ||
|
||
const name = "upstash-pause-resume-queue"; | ||
const queue = client.queue({ queueName: name }); | ||
await queue.upsert({ parallelism: 1 }); | ||
|
||
// pause queue | ||
await queue.pause(); | ||
|
||
const queueInfo = await queue.get(); | ||
console.log(queueInfo.paused); // prints true | ||
|
||
// resume queue | ||
await queue.resume(); | ||
``` |
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
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