Skip to content

Latest commit

 

History

History
88 lines (66 loc) · 1.37 KB

File metadata and controls

88 lines (66 loc) · 1.37 KB

Quick Start Guide

Get the task queue running in under 5 minutes.

Prerequisites

  • Python 3.8+
  • macOS, Linux, or Windows with WSL

Setup

1. Navigate to project

cd task-queue

2. Initialize database

bash scripts/init_db.sh

3. Open 3 terminals in the task-queue directory

Terminal 1 - Workers:

bash scripts/start_workers.sh 5

Terminal 2 - Monitor:

python3 src/monitor.py

Terminal 3 - Submit Tasks:

python3 examples/submit_tasks.py

What You'll See

Workers (Terminal 1):

Worker worker-0 started
[worker-0] Executing process_data
  Processing data record 5 with value 50
[worker-0] Completed: process_data

Monitor (Terminal 2):

QUEUE STATISTICS
Tasks:
  pending: 8
  in_progress: 5
  completed: 27
  failed: 0

Workers:
  active: 5

Throughput: 24 tasks/min

Quick Experiments

Submit more tasks:

python3 examples/submit_tasks.py

Test throughput:

python3 scripts/load_test.py --tasks 1000

Test failure recovery:

  • Press Ctrl+C in Terminal 1 (workers)
  • Watch Terminal 2 (monitor) reassign tasks

Stop Everything

Press Ctrl+C in each terminal to stop cleanly.

Next Steps

  • Read README.md for full documentation
  • Customize config.py for retry behavior
  • Add custom tasks in src/tasks.py
  • Run load tests for performance metrics