OpRegistry

A local, startup-time registry that maps symbolic OpIds to their Op implementations.

Every peer populates the registry at startup from the same compiled binary so that a later task descriptor { op, args } (warp slice C2) can look an op up by name and run its own registered copy. The function never moves across the fabric; only its name does.

Duplicate registration fails loud. A homogeneous binary registers each op exactly once at startup; registering the same OpId twice indicates a programming error and throws IllegalStateException.

resolve returning null is legitimate. An unknown OpId is a "bobbin not loaded yet" state — routine on the lazy-fetch path (warp slices C4/C5). Callers must handle null as a real case, not an invariant violation.

Thread-safety. The backing map is guarded by an explicit kotlinx.atomicfu.locks.ReentrantLock. This type is safe under a multi-threaded dispatcher. Op.invoke is not called inside the lock — the registry only stores and looks up; invocation is the caller's concern.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The set of OpIds currently registered in this registry.

Functions

Link copied to clipboard
fun register(id: OpId, op: Op)

Registers op under id.

Link copied to clipboard
fun resolve(id: OpId): Op?

Returns the Op registered under id, or null if no op has been registered for id.