trying to get simpler batcher working
This commit is contained in:
parent
df611a3ce3
commit
2f074271cc
5 changed files with 82 additions and 652 deletions
|
|
@ -81,29 +81,7 @@ export async function exampleBatchJobProcessor(jobData: any) {
|
|||
return result;
|
||||
}
|
||||
|
||||
// Comparison: Old vs New approach
|
||||
|
||||
// OLD COMPLEX WAY:
|
||||
/*
|
||||
const batchProcessor = new BatchProcessor(queueManager);
|
||||
await batchProcessor.initialize();
|
||||
await batchProcessor.processItems({
|
||||
items: symbols,
|
||||
batchSize: 200,
|
||||
totalDelayMs: 3600000,
|
||||
jobNamePrefix: 'yahoo-live',
|
||||
operation: 'live-data',
|
||||
service: 'data-service',
|
||||
provider: 'yahoo',
|
||||
priority: 2,
|
||||
createJobData: (symbol, index) => ({ symbol }),
|
||||
useBatching: true,
|
||||
removeOnComplete: 5,
|
||||
removeOnFail: 3
|
||||
});
|
||||
*/
|
||||
|
||||
// NEW SIMPLE WAY:
|
||||
// Example: Simple functional approach
|
||||
/*
|
||||
await processSymbols(symbols, queueManager, {
|
||||
operation: 'live-data',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue