thing im pretty much done with extracting the queue and making it reususable, maybe just a few more change to be able to making the batch names a bit more specific

This commit is contained in:
Boki 2025-06-14 18:22:28 -04:00
parent ad5e353ec3
commit e8c90532d5
14 changed files with 117 additions and 93 deletions

View file

@ -44,7 +44,7 @@ async function batchProcessingExample() {
[1, 2, 3, 4, 5], // Just pass the array directly!
queueManager,
{
totalDelayMs: 15000, // 15 seconds total
totalDelayHours: 0.0042, // 15 seconds
useBatching: false, // Direct mode
priority: 2,
provider: 'data-processor',
@ -63,7 +63,7 @@ async function batchProcessingExample() {
}));
const batchResult = await processItems(batchData, queueManager, {
totalDelayMs: 20000, // 20 seconds total
totalDelayHours: 0.0056, // 20 seconds
useBatching: true, // Batch mode
batchSize: 5, // 5 items per batch
priority: 1,
@ -80,7 +80,7 @@ async function batchProcessingExample() {
const symbolResult = await processItems(symbols, queueManager, {
operation: 'analyze-symbol',
provider: 'data-processor',
totalDelayMs: 25000, // 25 seconds total
totalDelayHours: 0.0069, // 25 seconds
useBatching: true,
batchSize: 3,
priority: 1,
@ -97,7 +97,7 @@ async function batchProcessingExample() {
}));
const largeResult = await processItems(largeDataset, queueManager, {
totalDelayMs: 60000, // 1 minute total
totalDelayHours: 0.0167, // 1 minute
useBatching: true,
batchSize: 50, // 50 items per batch
priority: 3,
@ -160,7 +160,7 @@ async function compareProcessingModes() {
console.log('Testing direct mode...');
const directStart = Date.now();
const directResult = await processItems(testData, queueManager, {
totalDelayMs: 10000,
totalDelayHours: 0.0028, // 10 seconds
useBatching: false,
provider: 'test',
operation: 'process',
@ -174,7 +174,7 @@ async function compareProcessingModes() {
console.log('Testing batch mode...');
const batchStart = Date.now();
const batchResult = await processItems(testData, queueManager, {
totalDelayMs: 10000,
totalDelayHours: 0.0028, // 10 seconds
useBatching: true,
batchSize: 5,
provider: 'test',