You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,9 +135,13 @@ If `true`, specifies that any [pending](https://developer.mozilla.org/en-US/docs
135
135
136
136
Adds a sync or async task to the queue.
137
137
138
-
Returns a promise with the return value of `fn`.
138
+
Returns a promise that settles when the task completes, not when it's added to the queue. The promise resolves with the return value of `fn`.
139
139
140
-
Note: If your items can potentially throw an exception, you must handle those errors from the returned Promise or they may be reported as an unhandled Promise rejection and potentially cause your process to exit immediately.
140
+
> [!IMPORTANT]
141
+
> If you `await` this promise, you will wait for the task to finish running, which may defeat the purpose of using a queue for concurrency. See the [Usage](#usage) section for examples.
142
+
143
+
> [!NOTE]
144
+
> If your items can potentially throw an exception, you must handle those errors from the returned Promise or they may be reported as an unhandled Promise rejection and potentially cause your process to exit immediately.
0 commit comments