Master

Running across many tabs as a queue

Many pages at once is a job that does not fit. The queue is the cut, and the queue is honest only when the point is written.

What you will see

t3 and t4. A rerun continues, which is not a restart.

About 1 min of reading

Try It

Write a queue and a point

1

Write the queue

printf 't1\nt2\nt3\nt4\n' > /tmp/q.txt; wc -l < /tmp/q.txt

Before you run it, say out loud what it will print. Then open the answer.

What it prints
4. Four tabs listed is the cut.
2

Write the point

printf 'done t1\ndone t2\n' > /tmp/d.txt; tail -1 /tmp/d.txt

Before you run it, say out loud what it will print. Then open the answer.

What it prints
done t2. The point is written, which is what a rerun reads.
3

Start after the point

printf 't1 t2 t3 t4\n' | tr ' ' '\n' | awk 'NR>2'

Before you run it, say out loud what it will print. Then open the answer.

What it prints
t3 and t4. A rerun continues, which is not a restart.

Data Flow

Many tabs to a queue and a point
1 The tabs are listed as a queue
↓
2 Each tab is run and reported
↓
3 The finished tab is written as the point
↓
4 A rerun reads the point and starts after it
Why this works
Why the queue is not a loop over a window

A window is a place that closes. A queue is a list that survives, and surviving is what a rerun needs.

The failure at this step

A rerun that starts at the first tab. The point is the answer, and the point names the tab.

Examples

The queue is written before it runs

The tabs are listed first. A listed queue is a queue that a rerun can be compared against.

The point is written per tab

The tab that finished is written. A written tab is a tab that a rerun does not redo.

A tab that refuses stops the run

The stop keeps the point. Keeping is what makes a rerun continue rather than restart.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

← A dark mode as a rule set in one pass
Previous Lesson
A dark mode as a rule set in one pass
Next Lesson
Shipping with every limit in one file
Shipping with every limit in one file →