Advanced

Parts talking as a named channel

The parts of an extension do not share a body. They share a channel, and a channel is a name that makes a message findable.

What you will see

refuse names ghost. Nothing is silent.

About 1 min of reading

Try It

Name a sender and a receiver

1

Write the channel

printf 'reader\nwriter\nreport\n' > /tmp/c.txt; wc -l < /tmp/c.txt

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

What it prints
3. Three parts is the channel, which is written.
2

Write a message

printf 'from=reader to=writer count=12\n' > /tmp/m.txt; cat /tmp/m.txt

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

What it prints
One line with a sender and a receiver. Named is traceable.
3

Refuse no receiver

printf 'to=ghost\n' | grep -c -f -x /tmp/c.txt /dev/stdin | awk '{print ($1==0) ? "refuse names ghost" : "ok"}'

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

What it prints
refuse names ghost. Nothing is silent.

Data Flow

A part to an answered message
1 The channel is written as a list of parts
↓
2 A message is written with a sender
↓
3 The receiver is named in the channel
↓
4 No receiver refuses with the name
Why this works
Why the channel is written

A written channel is a channel a reader lists. A channel in a name is a channel that cannot be listed.

The failure at this step

A message with no receiver. The channel is the answer, and the channel names the part.

Examples

The message has a sender

The sender is a name. A named sender is a message that can be traced back to a part.

The channel is one direction

One direction is one order. An order is what makes a message that arrived different from one that did not.

A message is answered or refused

Nothing is silent. Silence is what makes a part that never ran look like a part that ran.

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.

← Permissions narrowed to the page
Previous Lesson
Permissions narrowed to the page
Next Lesson
An off switch as a written state
An off switch as a written state →