Skip to content

Commit 6975b26

Browse files
committed
Remove the releasing concurrency section
1 parent 482cda2 commit 6975b26

File tree

1 file changed

+13
-48
lines changed

1 file changed

+13
-48
lines changed

docs/migrating-from-v3.mdx

Lines changed: 13 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ import MigrateV4UsingAi from "/snippets/migrate-v4-using-ai.mdx";
88

99
## What's new in v4?
1010

11-
| Feature | Description |
12-
|:--------|:------------|
13-
| [Wait for token](/wait-for-token) | Create and wait for tokens to be completed, enabling approval workflows and waiting for arbitrary external conditions. |
14-
| Wait idempotency | Skip waits if the same idempotency key is used again when using [wait for](/wait-for#wait-idempotency), [wait until](/wait-until#wait-idempotency), or [wait for token](/wait-for-token#wait-idempotency). |
15-
| [Priority](/runs/priority) | Specify a priority when triggering a task. |
16-
| [Global lifecycle hooks](/tasks/overview#global-lifecycle-hooks) | Register global lifecycle hooks that are executed for all runs, regardless of the task. |
17-
| [onWait and onResume](/tasks/overview#onwait-and-onresume-functions) | Run code when a run is paused or resumed because of a wait. |
18-
| [onComplete](/tasks/overview#oncomplete-function) | Run code when a run completes, regardless of whether it succeeded or failed. |
19-
| [onCancel](/tasks/overview#oncancel-function) | Run code when a run is cancelled. |
20-
| [Hidden tasks](/hidden-tasks) | Create tasks that are not exported from your trigger files but can still be executed. |
21-
| [Middleware & locals](#middleware-and-locals) | The middleware system runs at the top level, executing before and after all lifecycle hooks. The locals API allows sharing data between middleware and hooks. |
22-
| [useWaitToken](/frontend/react-hooks/use-wait-token) | Use the useWaitToken hook to complete a wait token from a React component. |
23-
| [ai.tool](/tasks/schemaTask#ai-tool) | Create an AI tool from an existing `schemaTask` to use with the Vercel [AI SDK](https://vercel.com/docs/ai-sdk). |
11+
| Feature | Description |
12+
| :------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
13+
| [Wait for token](/wait-for-token) | Create and wait for tokens to be completed, enabling approval workflows and waiting for arbitrary external conditions. |
14+
| Wait idempotency | Skip waits if the same idempotency key is used again when using [wait for](/wait-for#wait-idempotency), [wait until](/wait-until#wait-idempotency), or [wait for token](/wait-for-token#wait-idempotency). |
15+
| [Priority](/runs/priority) | Specify a priority when triggering a task. |
16+
| [Global lifecycle hooks](/tasks/overview#global-lifecycle-hooks) | Register global lifecycle hooks that are executed for all runs, regardless of the task. |
17+
| [onWait and onResume](/tasks/overview#onwait-and-onresume-functions) | Run code when a run is paused or resumed because of a wait. |
18+
| [onComplete](/tasks/overview#oncomplete-function) | Run code when a run completes, regardless of whether it succeeded or failed. |
19+
| [onCancel](/tasks/overview#oncancel-function) | Run code when a run is cancelled. |
20+
| [Hidden tasks](/hidden-tasks) | Create tasks that are not exported from your trigger files but can still be executed. |
21+
| [Middleware & locals](#middleware-and-locals) | The middleware system runs at the top level, executing before and after all lifecycle hooks. The locals API allows sharing data between middleware and hooks. |
22+
| [useWaitToken](/frontend/react-hooks/use-wait-token) | Use the useWaitToken hook to complete a wait token from a React component. |
23+
| [ai.tool](/tasks/schemaTask#ai-tool) | Create an AI tool from an existing `schemaTask` to use with the Vercel [AI SDK](https://vercel.com/docs/ai-sdk). |
2424

2525
## Node.js support
2626

@@ -210,41 +210,6 @@ await myTask.trigger({ foo: "bar" }); // Will use the queue defined on the task
210210
await myTask2.trigger({ foo: "bar" }); // Will use the queue defined on the task
211211
```
212212

213-
### Releasing concurrency on waits
214-
215-
We've changed the default behavior on how concurrency is released when a run is paused or resumed because of a wait. Previously, the concurrency would be released immediately when the run was first paused, no matter the settings on the queue.
216-
217-
Now we will no longer release concurrency on a queue that has a specified `concurrencyLimit` when a run is paused. You can go back to the previous behavior by setting the `releaseConcurrencyOnWaitpoint` option to `true` on the queue:
218-
219-
```ts
220-
const myQueue = queue({
221-
name: "my-queue",
222-
concurrencyLimit: 10,
223-
releaseConcurrencyOnWaitpoint: true,
224-
});
225-
```
226-
227-
You can also now control whether concurrency is released when performing a wait:
228-
229-
```ts
230-
// This will prevent the run from being released back into the queue when the wait starts
231-
await wait.for({ seconds: 10, releaseConcurrency: false });
232-
```
233-
234-
The new default behavior allows you to ensure that you can control the number of executing & waiting runs on a queue, and guarantee runs will resume once they are meant to be resumed.
235-
236-
<Note>
237-
If you do choose to release concurrency on waits, be aware that it's possible a resume is delayed
238-
if the concurrency that was released is not available at the time the wait completes. In this
239-
case, the run will go back into the queue and will resume once concurrency becomes available.
240-
</Note>
241-
242-
This new behavior effects all the wait functions:
243-
244-
- Wait for duration (e.g. `wait.for({ seconds: 10 })`)
245-
- Wait for a child task to complete (e.g. `myTask.triggerAndWait()`, `myTask.batchTriggerAndWait([...])`)
246-
- Wait for a token to complete (e.g. `wait.forToken(tokenId)`)
247-
248213
### Lifecycle hooks
249214

250215
We've changed the function signatures of the lifecycle hooks to be more consistent and easier to use, by unifying all the parameters into a single object that can be destructured.

0 commit comments

Comments
 (0)