Comparing version 1.1.2 to 1.1.3
@@ -58,18 +58,10 @@ export declare class Arehs<T, R> { | ||
* Calling the mapAsync function starts the process of asynchronously processing the input data and returning the results. | ||
* At this time, each task can have multiple tasks running at the same time, but this is limited by the concurrency setting. | ||
* This can be used as a useful tool for effectively managing and controlling large data processing jobs. | ||
* | ||
* @param processor | ||
*/ | ||
mapAsync(processor: (data: T) => Promise<R>): Promise<R[]>; | ||
/** | ||
* Calling the mapAsyncWithRetry function initiates the process of asynchronously processing the input data with retry logic applied to the processing function. | ||
* If an error occurs during processing, the function retries according to the specified retry limit. | ||
* If the retry limit is reached and the stopOnFailure option is set to true, the function stops processing and emits appropriate events. | ||
* If the stopOnFailure option is set to true, the function stops processing and emits appropriate events. | ||
* This can be useful for handling transient errors or ensuring data processing resilience. | ||
* Also, if the retryLimit option is greater than 0, you can set a limit on the number of retries on failure. | ||
* | ||
* @param processor The function responsible for processing each data item with retry logic applied. | ||
* @param processor The function responsible for processing each data item. If allowStopOnFailure is true, retry logic is applied. | ||
* @returns A Promise that resolves to an array of results after processing all data items. | ||
*/ | ||
mapAsyncWithRetry(processor: (data: T) => Promise<R>): Promise<R[]>; | ||
mapAsync(processor: (data: T) => Promise<R>): Promise<R[]>; | ||
/** | ||
@@ -76,0 +68,0 @@ * Method that waits for the currently in-progress task to not exceed the concurrency limit. |
@@ -90,21 +90,10 @@ "use strict"; | ||
* Calling the mapAsync function starts the process of asynchronously processing the input data and returning the results. | ||
* At this time, each task can have multiple tasks running at the same time, but this is limited by the concurrency setting. | ||
* This can be used as a useful tool for effectively managing and controlling large data processing jobs. | ||
* | ||
* @param processor | ||
*/ | ||
mapAsync(processor) { | ||
this.processor = processor; | ||
return this._executeProcess(); | ||
} | ||
/** | ||
* Calling the mapAsyncWithRetry function initiates the process of asynchronously processing the input data with retry logic applied to the processing function. | ||
* If an error occurs during processing, the function retries according to the specified retry limit. | ||
* If the retry limit is reached and the stopOnFailure option is set to true, the function stops processing and emits appropriate events. | ||
* If the stopOnFailure option is set to true, the function stops processing and emits appropriate events. | ||
* This can be useful for handling transient errors or ensuring data processing resilience. | ||
* Also, if the retryLimit option is greater than 0, you can set a limit on the number of retries on failure. | ||
* | ||
* @param processor The function responsible for processing each data item with retry logic applied. | ||
* @param processor The function responsible for processing each data item. If allowStopOnFailure is true, retry logic is applied. | ||
* @returns A Promise that resolves to an array of results after processing all data items. | ||
*/ | ||
mapAsyncWithRetry(processor) { | ||
mapAsync(processor) { | ||
const retryableProcessor = (data) => __awaiter(this, void 0, void 0, function* () { | ||
@@ -136,3 +125,4 @@ let attempts = 0; | ||
}); | ||
return this.mapAsync(retryableProcessor); | ||
this.processor = this.allowStopOnFailure ? retryableProcessor : processor; | ||
return this._executeProcess(); | ||
} | ||
@@ -139,0 +129,0 @@ /** |
@@ -58,18 +58,10 @@ export declare class Arehs<T, R> { | ||
* Calling the mapAsync function starts the process of asynchronously processing the input data and returning the results. | ||
* At this time, each task can have multiple tasks running at the same time, but this is limited by the concurrency setting. | ||
* This can be used as a useful tool for effectively managing and controlling large data processing jobs. | ||
* | ||
* @param processor | ||
*/ | ||
mapAsync(processor: (data: T) => Promise<R>): Promise<R[]>; | ||
/** | ||
* Calling the mapAsyncWithRetry function initiates the process of asynchronously processing the input data with retry logic applied to the processing function. | ||
* If an error occurs during processing, the function retries according to the specified retry limit. | ||
* If the retry limit is reached and the stopOnFailure option is set to true, the function stops processing and emits appropriate events. | ||
* If the stopOnFailure option is set to true, the function stops processing and emits appropriate events. | ||
* This can be useful for handling transient errors or ensuring data processing resilience. | ||
* Also, if the retryLimit option is greater than 0, you can set a limit on the number of retries on failure. | ||
* | ||
* @param processor The function responsible for processing each data item with retry logic applied. | ||
* @param processor The function responsible for processing each data item. If allowStopOnFailure is true, retry logic is applied. | ||
* @returns A Promise that resolves to an array of results after processing all data items. | ||
*/ | ||
mapAsyncWithRetry(processor: (data: T) => Promise<R>): Promise<R[]>; | ||
mapAsync(processor: (data: T) => Promise<R>): Promise<R[]>; | ||
/** | ||
@@ -76,0 +68,0 @@ * Method that waits for the currently in-progress task to not exceed the concurrency limit. |
@@ -90,21 +90,10 @@ import { EventEmitter } from 'events'; | ||
* Calling the mapAsync function starts the process of asynchronously processing the input data and returning the results. | ||
* At this time, each task can have multiple tasks running at the same time, but this is limited by the concurrency setting. | ||
* This can be used as a useful tool for effectively managing and controlling large data processing jobs. | ||
* | ||
* @param processor | ||
*/ | ||
mapAsync(processor) { | ||
this.processor = processor; | ||
return this._executeProcess(); | ||
} | ||
/** | ||
* Calling the mapAsyncWithRetry function initiates the process of asynchronously processing the input data with retry logic applied to the processing function. | ||
* If an error occurs during processing, the function retries according to the specified retry limit. | ||
* If the retry limit is reached and the stopOnFailure option is set to true, the function stops processing and emits appropriate events. | ||
* If the stopOnFailure option is set to true, the function stops processing and emits appropriate events. | ||
* This can be useful for handling transient errors or ensuring data processing resilience. | ||
* Also, if the retryLimit option is greater than 0, you can set a limit on the number of retries on failure. | ||
* | ||
* @param processor The function responsible for processing each data item with retry logic applied. | ||
* @param processor The function responsible for processing each data item. If allowStopOnFailure is true, retry logic is applied. | ||
* @returns A Promise that resolves to an array of results after processing all data items. | ||
*/ | ||
mapAsyncWithRetry(processor) { | ||
mapAsync(processor) { | ||
const retryableProcessor = async (data) => { | ||
@@ -136,3 +125,4 @@ let attempts = 0; | ||
}; | ||
return this.mapAsync(retryableProcessor); | ||
this.processor = this.allowStopOnFailure ? retryableProcessor : processor; | ||
return this._executeProcess(); | ||
} | ||
@@ -139,0 +129,0 @@ /** |
{ | ||
"name": "arehs", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "The ares ensures the best possible large batch processing, which is oriented towards event-driven chunk processing.", | ||
@@ -32,2 +32,3 @@ "main": "dist/cjs/index.js", | ||
"async", | ||
"await", | ||
"promise", | ||
@@ -41,3 +42,9 @@ "promisepool", | ||
"large", | ||
"chunk" | ||
"chunk", | ||
"bluebird", | ||
"p-map", | ||
"concurrently", | ||
"parallel", | ||
"promises", | ||
"wait" | ||
], | ||
@@ -44,0 +51,0 @@ "repository": { |
@@ -41,15 +41,10 @@ <p align="center"> | ||
operation takes longer than the timeout time(ms). | ||
* `stopOnFailure`: Set whether to stop on failure. | ||
* `stopOnFailure`: If the stopOnFailure option is set to true, the function stops processing and emits appropriate | ||
events. | ||
* `retryLimit`: Set a limit on the number of retries on failure. | ||
* `mapAsync`: Calling the mapAsync function starts the process of asynchronously processing the input data and returning | ||
the results. | ||
At this time, each task can have multiple tasks running at the same time, but this is limited by the concurrency | ||
setting. | ||
This can be used as a useful tool for effectively managing and controlling large data processing jobs. | ||
* `mapAsyncWithRetry`: Calling the mapAsyncWithRetry function initiates the process of asynchronously processing the | ||
input data with retry logic applied to the processing function. | ||
If an error occurs during processing, the function retries according to the specified retry limit. | ||
If the retry limit is reached and the stopOnFailure option is set to true, the function stops processing and | ||
emits appropriate events. | ||
This can be useful for handling transient errors or ensuring data processing resilience. | ||
If the stopOnFailure option is set to true, the function stops processing and emits appropriate events. | ||
This can be useful for handling transient errors or ensuring data processing resilience. Also, if the retryLimit | ||
option is greater than 0, you can set a limit on the number of retries on failure. | ||
@@ -56,0 +51,0 @@ ```typescript |
@@ -98,22 +98,10 @@ import { EventEmitter } from 'events'; | ||
* Calling the mapAsync function starts the process of asynchronously processing the input data and returning the results. | ||
* At this time, each task can have multiple tasks running at the same time, but this is limited by the concurrency setting. | ||
* This can be used as a useful tool for effectively managing and controlling large data processing jobs. | ||
* | ||
* @param processor | ||
*/ | ||
mapAsync(processor: (data: T) => Promise<R>): Promise<R[]> { | ||
this.processor = processor; | ||
return this._executeProcess(); | ||
} | ||
/** | ||
* Calling the mapAsyncWithRetry function initiates the process of asynchronously processing the input data with retry logic applied to the processing function. | ||
* If an error occurs during processing, the function retries according to the specified retry limit. | ||
* If the retry limit is reached and the stopOnFailure option is set to true, the function stops processing and emits appropriate events. | ||
* If the stopOnFailure option is set to true, the function stops processing and emits appropriate events. | ||
* This can be useful for handling transient errors or ensuring data processing resilience. | ||
* Also, if the retryLimit option is greater than 0, you can set a limit on the number of retries on failure. | ||
* | ||
* @param processor The function responsible for processing each data item with retry logic applied. | ||
* @param processor The function responsible for processing each data item. If allowStopOnFailure is true, retry logic is applied. | ||
* @returns A Promise that resolves to an array of results after processing all data items. | ||
*/ | ||
mapAsyncWithRetry(processor: (data: T) => Promise<R>): Promise<R[]> { | ||
mapAsync(processor: (data: T) => Promise<R>): Promise<R[]> { | ||
const retryableProcessor = async (data: T) => { | ||
@@ -142,3 +130,4 @@ let attempts = 0; | ||
}; | ||
return this.mapAsync(retryableProcessor); | ||
this.processor = this.allowStopOnFailure ? retryableProcessor : processor; | ||
return this._executeProcess(); | ||
} | ||
@@ -145,0 +134,0 @@ |
@@ -63,3 +63,3 @@ import { Arehs } from '../src'; | ||
.retryLimit(3) | ||
.mapAsyncWithRetry(delayOrError); | ||
.mapAsync(delayOrError); | ||
const endArehs = performance.now(); | ||
@@ -66,0 +66,0 @@ |
67500
1011
141