Skip to content

Commit 4676c85

Browse files
committed
Enhancing method docs
1 parent 26549e8 commit 4676c85

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

dist/zero-backpressure-semaphore.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ export declare class ZeroBackpressureSemaphore<T, UncaughtErrorType = Error> {
8888
* This method is particularly useful for executing multiple or background jobs, where no return
8989
* value is expected.
9090
*
91+
* If the job throws an error, it is captured by the semaphore and can be accessed via the
92+
* `extractUncaughtError` method. Users are encouraged to specify a custom `UncaughtErrorType`
93+
* generic parameter to the class if jobs may throw errors.
94+
*
9195
* @param job - The job to be executed once the semaphore is available.
9296
* @returns A promise that resolves when the job starts execution.
9397
*/
@@ -109,6 +113,7 @@ export declare class ZeroBackpressureSemaphore<T, UncaughtErrorType = Error> {
109113
* or rejects, you can continue the route handler's flow based on the result.
110114
*
111115
* @param job - The job to be executed once the semaphore is available.
116+
* @throws - Error thrown by the job itself.
112117
* @returns A promise that resolves with the job's return value or rejects with its error.
113118
*/
114119
waitForCompletion(job: SemaphoreJob<T>): Promise<T>;

dist/zero-backpressure-semaphore.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/zero-backpressure-semaphore.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/zero-backpressure-semaphore.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ export class ZeroBackpressureSemaphore<T, UncaughtErrorType = Error> {
133133
* This method is particularly useful for executing multiple or background jobs, where no return
134134
* value is expected.
135135
*
136+
* If the job throws an error, it is captured by the semaphore and can be accessed via the
137+
* `extractUncaughtError` method. Users are encouraged to specify a custom `UncaughtErrorType`
138+
* generic parameter to the class if jobs may throw errors.
139+
*
136140
* @param job - The job to be executed once the semaphore is available.
137141
* @returns A promise that resolves when the job starts execution.
138142
*/
@@ -159,6 +163,7 @@ export class ZeroBackpressureSemaphore<T, UncaughtErrorType = Error> {
159163
* or rejects, you can continue the route handler's flow based on the result.
160164
*
161165
* @param job - The job to be executed once the semaphore is available.
166+
* @throws - Error thrown by the job itself.
162167
* @returns A promise that resolves with the job's return value or rejects with its error.
163168
*/
164169
public async waitForCompletion(job: SemaphoreJob<T>): Promise<T> {

0 commit comments

Comments
 (0)