Add runnable examples demonstrating job-queue usage - #309
Conversation
Adds six self-contained example projects under examples/, each showing a different real-world use case paired with one of the library's backends, plus a top-level README indexing them all: - mp4-to-hls (SQLite) - transcode video into HLS with ffmpeg - email-sending (Redis) - background email via nodemailer + Ethereal - csv-import (Postgres) - stream-parse and bulk-insert a CSV file - image-thumbnails (SQLite) - resize images with sharp - webhook-delivery (SQLite) - retry-with-backoff using the fail/retry hooks - pdf-report-generation (SQLite) - render a PDF invoice with pdfkit Each example depends on the library via `file:../..` and follows the same shape (src/queue.ts, src/worker.ts, src/add-job.ts, src/start-worker.ts) so the pattern is easy to compare across examples. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Summary
examples/, each pairing a real-world use case with one of the library's backends, plus a top-levelexamples/README.mdindexing them all:.m3u8+.ts) with ffmpegfail/retryhooks rather than justadd/takefile:../..and follows the same shape (src/queue.ts,src/worker.ts,src/add-job.ts,src/start-worker.ts), so the pattern is easy to compare across examples and backends.Test plan
npm install,npx tsc --noEmit— cleannpx @biomejs/biome check— clean on all example files.m3u8playlist +.tssegmentcompleted.webpoutputsfailedafter 3 retries)npm t(root package, via pre-commit hook) — 69/69 tests pass, unaffected by this change🤖 Generated with Claude Code