Skip to content

Commit cbaee58

Browse files
committed
fixing typos and adding content to task queues page
1 parent 27a2a9a commit cbaee58

File tree

3 files changed

+39
-11
lines changed

3 files changed

+39
-11
lines changed

feeds/all.atom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<feed xmlns="http://www.w3.org/2005/Atom"><title>Matt Makai</title><link href="http://www.fullstackpython.com/" rel="alternate"></link><link href="http://www.fullstackpython.com/feeds/all.atom.xml" rel="self"></link><id>http://www.fullstackpython.com/</id><updated>2014-05-08T06:56:34Z</updated></feed>
2+
<feed xmlns="http://www.w3.org/2005/Atom"><title>Matt Makai</title><link href="http://www.fullstackpython.com/" rel="alternate"></link><link href="http://www.fullstackpython.com/feeds/all.atom.xml" rel="self"></link><id>http://www.fullstackpython.com/</id><updated>2014-05-09T07:05:53Z</updated></feed>

source/content/pages/07-performance/0705-task-queues.markdown

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,27 @@ choice4text:
1717

1818

1919
# Task queues
20-
Task queues handle background work that need to be processed outside the
21-
usual HTTP request-response cycle. These tasks are handled asynchronously
22-
because HTTP requests must be responded back to by the server as fast as
23-
possible otherwise the user experience in the web browser will suffer. The
24-
most common types of jobs for task queues include
20+
Task queues handle background work processed outside the usual HTTP
21+
request-response cycle.
22+
23+
## Why are tasks queues necessary?
24+
Some tasks are handled asynchronously either because they are not initiated by
25+
an HTTP request or because they are long-running jobs that take longer than
26+
a few milliseconds.
27+
28+
For example, a web application could poll the GitHub API every 10 minutes to
29+
find out what are the top 100 starred repositories. A task queue would be set
30+
up to automatically call the GitHub API, process the results and store them
31+
in a persistent database for later use.
32+
33+
Another example is when a database query would take too long during the HTTP
34+
request-response cycle. The query could be performed in the background on a
35+
fixed interval with the results stored in the database. Then when the
36+
HTTP request comes in it could fetch the calculated results from the database
37+
instead of re-executing the query. This is a form of [caching](/caching.html)
38+
enabled by task queues.
39+
40+
Other types of jobs for task queues include
2541

2642
* calculating computationally expensive data analytics
2743

task-queues.html

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,23 @@
4545
<div class="row">
4646
<div class="col-md-8">
4747
<h1>Task queues</h1>
48-
<p>Task queues handle background work that need to be processed outside the
49-
usual HTTP request-response cycle. These tasks are handled asynchronously
50-
because HTTP requests must be responded back to by the server as fast as
51-
possible otherwise the user experience in the web browser will suffer. The
52-
most common types of jobs for task queues include</p>
48+
<p>Task queues handle background work processed outside the usual HTTP
49+
request-response cycle. </p>
50+
<h2>Why are tasks queues necessary?</h2>
51+
<p>Some tasks are handled asynchronously either because they are not initiated by
52+
an HTTP request or because they are long-running jobs that take longer than
53+
a few milliseconds. </p>
54+
<p>For example, a web application could poll the GitHub API every 10 minutes to
55+
find out what are the top 100 starred repositories. A task queue would be set
56+
up to automatically call the GitHub API, process the results and store them
57+
in a persistent database for later use.</p>
58+
<p>Another example is when a database query would take too long during the HTTP
59+
request-response cycle. The query could be performed in the background on a
60+
fixed interval with the results stored in the database. Then when the
61+
HTTP request comes in it could fetch the calculated results from the database
62+
instead of re-executing the query. This is a form of <a href="/caching.html">caching</a>
63+
enabled by task queues.</p>
64+
<p>Other types of jobs for task queues include</p>
5365
<ul>
5466
<li>
5567
<p>calculating computationally expensive data analytics</p>

0 commit comments

Comments
 (0)