Hands-on practice for this lecture. Work through the exercises and quizzes to reinforce what you've learned.
Exercise 1 of 2
Set the concurrent request count and watch how a thread-per-request model stacks up blocking threads while an event loop handles the same load with a single thread.
Both models finish in the same wall-clock time for IO-bound work. The event loop advantage is resource efficiency: 1,000 concurrent users needs 1,000 threads (~2GB) on TPR vs a single event loop thread. This is why Node.js was built.
Exercise 2 of 2
Submit compression jobs and watch the server respond in under 1ms while a background worker handles the queue. Shows how queues break synchronous coupling at the system level.
Click Submit Job. The server responds in under 1ms with a job ID — no waiting for compression to finish. Submit multiple jobs to watch them queue up.
The client received a response in under 1ms. Actual processing takes 3+ seconds — but the connection is already closed. The client saved the job ID and can poll or receive a webhook when done. This is exactly how Sidekiq, Bull, Celery, and AWS SQS work.