class

ContributorMural::Embedder

Inherits Reference < Object

Fetches avatars in parallel and turns them into base64 data URIs. Results are cached by URL so multiple render targets reuse fetches.

Constants

DEFAULT_CONCURRENCY = 12

The work here is almost entirely waiting, so the ceiling is set by politeness to the host rather than by anything local. Connections are kept alive now, so a worker pays for one handshake instead of one per avatar — which is what makes a wider pool worth having rather than just louder.

Constructors

new(source : AvatarSource, concurrency : Int32 = DEFAULT_CONCURRENCY, salvage : Proc(Hash(String, String)) | Nil = nil)
Source

Instance methods

embed(users : Array(ResolvedUser), renderer : Renderer, fail_on_missing : Bool) : Tuple(Array(EmbeddedUser), Array(Skipped))

Returns users with embedded avatars (input order preserved) and the people skipped due to fetch failures. Raises the first failure instead when fail_on_missing is set.

Source
salvaged

Who kept the face the previous wall already had, because this run could not fetch theirs. Accumulated here rather than returned per target: the cache is what makes it a run-wide fact, and the caller reports it once.

Source
warm(users : Array(ResolvedUser), renderers : Array(Renderer)) : Nil

Fetches everything every target will ask for in a single fan-out. A config with more than one output used to fetch per target and wait out a separate round of latency each time, even where the two targets wanted the same faces at the same size.

Source

Nested types