Hyperlinkv0.9.0-beta.0

Hyperlink

Hyperlink.withHandoffconstsrc/Hyperlink.ts:3187
<T extends PipeableTag>(strategy: HandoffStrategy): (tag: T) => T
<Self, S extends Spec, HSelf>(
  tag: NodeBoundTag<Self, S, HSelf>,
  strategy: HandoffStrategy
): NodeBoundTag<Self, S, HSelf>
<Self, S extends Spec>(
  tag: HyperlinkTag<Self, S>,
  strategy: HandoffStrategy
): HyperlinkTag<Self, S>

Attach an opt-in cutover strategy to a HyperService tag (Locked #33). Default is off — absent stamp ⇒ Track C does not migrate this HyperService (#29). Dual (data-first or .pipe):

class Jobs extends WorkPool.Tag<Jobs>()("app/Jobs", { payload: Item }).pipe(
  Hyperlink.withHandoff("drainOnly"),
) {}

Strategies:

  • "drainOnly" — WorkPool shutdown + wait phase === "off"
  • "workPoolRelease" — local releaseEncoded/release then shutdown (peer enqueue = #34)

Run during Node.shutdown after drain and before Lookup leave. Non-WorkPool kinds log and no-op.

spec fieldsNode.shutdown
Source src/Hyperlink.ts:318716 lines
export const withHandoff: {
  <T extends PipeableTag>(strategy: HandoffStrategy): (tag: T) => T;
  <Self, S extends Spec, HSelf>(
    tag: NodeBoundTag<Self, S, HSelf>,
    strategy: HandoffStrategy,
  ): NodeBoundTag<Self, S, HSelf>;
  <Self, S extends Spec>(
    tag: HyperlinkTag<Self, S>,
    strategy: HandoffStrategy,
  ): HyperlinkTag<Self, S>;
} = Fn.dual(
  2,
  <T extends HyperlinkTag<any, any, any>>(tag: T, strategy: HandoffStrategy): T =>
    // SAFE: same stamp pattern as withReadiness — Object.assign mutates the tag identity; T is preserved.
    Object.assign(tag, { [handoffSym]: strategy }) as T,
);