Week 9 - Asynchronous Tasks
Week 9 - Asynchronous Tasks
Web servers ●
●
How does a web server work
Threads and background tasks
● Long running tasks
Web server
Simplest possible HTTP server
● User uploads photo, but gets no response ● Only one user can upload a photo at a
till task complete time?
● Cannot navigate away, do not know ● Large photos block server for long time
response ● Uncontrolled thread creation drags down
server performance
General problem
● Should web server directly run compute intensive tasks?
○ Or stick to handling application logic, rendering, file serving?
● Can tasks be handed off to outside servers
○ Specialized for types of compute
○ Different scaling algorithms than web
● How should web server and compute servers communicate?
○ Automatically handle scaling
○ Allow easy task distribution
Asynchronous Task Frameworks
Goals:
We are mostly interested in Python APIs, but exist for most languages