2525│ ├── adapter-drizzle/ # Drizzle ORM adapter (PostgreSQL)
2626│ └── adapter-prisma/ # Prisma ORM adapter (PostgreSQL)
2727├── examples/ # Standalone usage examples
28- │ ├── drizzle-pg/ # Drizzle + node-postgres
29- │ ├── drizzle-postgres/ # Drizzle + postgres.js
30- │ ├── progress-tracking/ # Real-time progress updates
31- │ ├── event-system/ # Comprehensive event monitoring
32- │ └── pm2-workers/ # Production deployment with PM2
3328└── tooling/ # Shared development tools
3429```
3530
@@ -84,22 +79,22 @@ const queue = new Queue(new PostgresPrismaQueueAdapter(prisma), { name: "my-queu
8479// Register job handlers
8580queue .register <EmailPayload , EmailResult >(" send-email" , async (job ) => {
8681 console .log (` Sending email to ${job .payload .to } ` )
87-
82+
8883 // Send email logic here
8984 await sendEmail (job .payload )
90-
85+
9186 // Return result - will be stored in job.result field
92- return {
93- messageId: " msg_123" ,
94- sent: true
87+ return {
88+ messageId: " msg_123" ,
89+ sent: true ,
9590 }
9691})
9792
9893// Add jobs
99- await queue .add (" send-email" , {
100- 101- subject: " Welcome!" ,
102- body: " Welcome to our service!"
94+ await queue .add (" send-email" , {
95+ 96+ subject: " Welcome!" ,
97+ body: " Welcome to our service!" ,
10398})
10499await queue .add (
105100 " send-email" ,
@@ -116,14 +111,7 @@ queue.start()
116111
117112## Examples
118113
119- Check out the [ examples directory] ( ./examples/ ) for complete, runnable examples:
120-
121- - ** [ drizzle-pg] ( ./examples/drizzle-pg/ ) ** - Basic example using Drizzle ORM with node-postgres (pg)
122- - ** [ drizzle-pglite] ( ./examples/drizzle-pglite/ ) ** - Zero-setup example using Drizzle ORM with PGlite (embedded PostgreSQL)
123- - ** [ drizzle-postgres] ( ./examples/drizzle-postgres/ ) ** - Advanced example using Drizzle ORM with postgres.js and recurring jobs
124- - ** [ event-system] ( ./examples/event-system/ ) ** - Comprehensive event monitoring and statistics using Drizzle ORM with postgres.js
125- - ** [ pm2-workers] ( ./examples/pm2-workers/ ) ** - Manage multiple Vorsteh Queues with PM2 using Drizzle ORM with postgres.js
126- - ** [ progress-tracking] ( ./examples/progress-tracking/ ) ** - Real-time job progress tracking using Drizzle ORM with postgres.js
114+ Check out the [ examples directory] ( ./examples/ ) for complete, runnable examples.
127115
128116> ** Note** : All examples demonstrate the UTC-first timezone approach and automatic job cleanup features.
129117
@@ -226,7 +214,7 @@ queue.register<{ items: string[] }, ProcessResult>("process-data", async (job) =
226214 return {
227215 processed ,
228216 errors ,
229- duration: Date .now () - startTime
217+ duration: Date .now () - startTime ,
230218 }
231219})
232220
0 commit comments