Master

Shipping with every limit in one file

An extension ships when the numbers are inside the limits. The limits are one file, and one file is why a refusal can name the limit it broke.

What you will see

One line with the numbers. Written is what a change is compared against.

About 1 min of reading

Try It

Ship with named limits

1

Write the limits

printf 'hosts 2 nodes 20 depth 3 refusals 0\n' > /tmp/l.txt; wc -w < /tmp/l.txt

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

What it prints
8. Four names and four numbers is one file.
2

Compare name by name

printf 'refusals 0\nmax_refusals 0\n' | awk '{print ($1>$3) ? "breach refusals" : "ok refusals"}'

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

What it prints
ok refusals. One comparison per limit is a separate line.
3

Write the shipped numbers

printf 'shipped version 3 hosts 2 nodes 18\n' >> /tmp/s.txt; tail -1 /tmp/s.txt

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

What it prints
One line with the numbers. Written is what a change is compared against.

Data Flow

A report and limits to a ship
1 The limits are written as names and numbers
↓
2 The report is compared name by name
↓
3 Each breach is written as its own line
↓
4 The ship writes the numbers and the version
Why this works
Why a limit is never a default in code

A default in code is a limit nobody can read. A limit in a file is a limit that a refusal can name.

The one limit that is not a number

The set of hosts that must be named. A set is a limit, and a host outside it is a breach of that limit.

Examples

The limits are names and numbers

Hosts, nodes touched, depth, refusals. Names are what a refusal repeats, and a refusal that repeats is actionable.

The report is compared name by name

One comparison per limit. One per limit is what makes every breach a separate line.

The ship writes what it shipped with

The numbers and the version. Written is what a later change is compared against.

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.

← Running across many tabs as a queue
Previous Lesson
Running across many tabs as a queue