Skip to main content

Module pull

Module pull 

Source
Expand description

Pull mode: serving a broadcast ticket’s broadcast from the media relay.

The media relay’s Node uses the cluster origin as its route table. When a session names a valid BroadcastTicket, the node subscribes to the ticket’s broadcast, and the publisher’s session announces it straight into the cluster at its own path. The node’s base grant is nothing, and each pull holds a PathClaim that lets the publisher announce the pulled path and the paths beneath it, so its other broadcasts stay out. The media relay pulls only a path the ticket’s peer owns: its canonical live/<peer>/<name> path, or a room path with the peer as member. Anything else is refused with NotOwner. A session that named the ticket reads it under the name it asked for through mounted.

A pull retires once no local session that named the ticket has held its PullGuard for the linger window. Its path then leaves the publisher’s grant, which takes the broadcast out of the cluster, and when the last pull of a publisher retires, the media relay closes its session with that publisher. An idle timer on the connection cannot stand in for the guards, since iroh’s keep-alives move its counters too.

Every pull dials an iroh endpoint the session chose, so admission into pulls is bounded. Access says which sessions may pull at all: by default only one whose token grants reading the ticket’s path. Limits caps the pulls the media relay holds at once, the pulls one Client holds, and how fast one client starts new dials. A session names one broadcast in its path, so it holds at most one pull.

run sets this up. The module is public for a binary that embeds the media relay, and for the tests.

Structs§

Limits
Bounds on the pulls a media relay holds and starts.
PullGuard
A hold on a pull, which keeps it alive while the session that asked for it runs.
Pulls
The media relay’s pulls, shared by every session that names a ticket.

Enums§

Access
Which sessions may pull the ticket they name.
Client
Who asks for a pull, as the per-client Limits count it.

Functions§

mounted
Returns cluster with requested reading the broadcast its ticket names.