Lesson 41 — Concurrent Web Scraper
Mini-project tổng hợp Tier 3: worker pool, rate limit, context, retry, JSON output.
Module 1 — Scraper Architecture Flow
Click vào từng component để xem code snippet thật trong project. Tổng cộng 6 file: main.go, scraper.go, ratelimit.go, parser.go, output.go, retry.go.
// Click 1 component ở sơ đồ trên để xem code
// Mỗi component map 1 file Go trong solutions/
Module 2 — Worker Simulation
Chỉnh worker count, rate limit, số URL → quan sát token bucket cấp token cho worker, worker fetch (1-2s mỗi URL), ghi result. Progress bar + throughput tính realtime.
📋 Queue
👷 Workers
0
tokens
📄 Result.json
Elapsed: 0.0s
Throughput: 0.0 req/s
Success: 0
Failed: 0
Module 3 — Retry Timeline
Mô phỏng 1 URL fail nhiều lần với exponential backoff: attempt 1 fail → đợi 1s → attempt 2 fail → đợi 2s → attempt 3 → success hoặc give up. Chọn kịch bản để xem timeline.
// Chọn kịch bản và bấm "Chạy" để xem retry timeline