Skip to content

Commit e2f6105

Browse files
committed
wip
1 parent 284c7d7 commit e2f6105

2 files changed

Lines changed: 3 additions & 22 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ This is `adapter-queue`, a TypeScript queue system inspired by Yii2-Queue archit
1212
- Define job types as TypeScript interfaces (not classes) for type safety
1313
- Register job handlers using type-safe `setHandlers()` method
1414
- Add jobs to queues with compile-time validation of payloads and options
15-
- Process jobs asynchronously with configurable workers
15+
- Process jobs asynchronously
1616
- Switch between storage backends (File, Database, SQS) without changing job code
1717
- Monitor job lifecycle through built-in events
18-
- Run jobs in isolated processes for improved stability
1918

2019
Key differentiator: Unlike traditional job queue systems that require job classes, this uses an event-based approach where you define job types as interfaces and register handlers as functions, making it simpler and more TypeScript-friendly.
2120

@@ -27,18 +26,6 @@ Key differentiator: Unlike traditional job queue systems that require job classe
2726
- `pnpm run lint` - Type checking with TypeScript compiler
2827
- `pnpm test` - Run all tests with Vitest
2928

30-
### Worker Commands
31-
- `pnpm run queue:worker` - Start a queue worker
32-
- `pnpm run queue:worker:isolate` - Start worker with job isolation
33-
34-
### CLI Worker Options
35-
The CLI worker supports these arguments:
36-
- `--driver <type>` - Queue driver: 'db' or 'sqs' (default: db)
37-
- `--isolate` - Run jobs in isolated child processes
38-
- `--no-repeat` - Run once and exit (default: run continuously)
39-
- `--timeout <sec>` - Polling timeout in seconds (default: 3)
40-
- `--queue-url <url>` - SQS queue URL (required for SQS driver)
41-
4229
## Architecture Overview
4330

4431
### Core Components
@@ -49,8 +36,7 @@ The CLI worker supports these arguments:
4936
- **SqsQueue** (`src/drivers/sqs.ts`): Amazon SQS-backed queue
5037
- **FileQueue** (`src/drivers/file.ts`): File-based queue storing jobs as individual files with JSON index
5138
3. **Jobs**: Defined as TypeScript interfaces in a JobMap, with handlers registered via `setHandlers()` method
52-
4. **Workers**: Long-running processes that consume and execute jobs
53-
5. **Serialization**: Pluggable serialization system for job payloads
39+
4. **Serialization**: Pluggable serialization system for job payloads
5440

5541
### Key Interfaces
5642

@@ -89,17 +75,13 @@ When implementing DatabaseAdapter, you must provide:
8975
- Uses Vitest for testing
9076
- Test setup file: `tests/setup.ts`
9177
- Mock implementations available in `tests/mocks/`
92-
- Tests organized by component: `core/`, `drivers/`, `worker/`
93-
94-
### Worker Isolation
95-
Workers can run jobs in isolated child processes using the `--isolate` flag or `isolate: true` option. This improves stability by preventing job failures from crashing the worker process.
78+
- Tests organized by component: `core/`, `drivers/`
9679

9780
## Example Project
9881
The `example-queue-project/` directory contains a working example with SQLite database adapter implementation.
9982

10083
## Important Notes
10184

102-
- The CLI worker is a template - it requires user-provided database adapters or SQS clients
10385
- Jobs are serialized as JSON strings (job name + payload) and stored as Buffers in database adapters
10486
- TTR (Time To Run) defaults to 300 seconds but can be configured per job
10587
- SQS driver uses message attributes for metadata and base64 encoding for payloads

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"keywords": [
2424
"queue",
2525
"job",
26-
"worker",
2726
"sqs",
2827
"database",
2928
"typescript",

0 commit comments

Comments
 (0)