<Self>(): {
<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(
key: string,
config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>
}
): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>
<
F extends Schema.Struct.Fields,
Success extends Schema.Top = Schema.Void
>(
key: string,
config: PriorityTagConfig<F, Success>
): HyperlinkTag<Self, PriorityInstanceSpec<F>>
}Define an N-level managed queue as a named service Tag (also exported as
priority): class Jobs extends WorkPool.priority<Jobs>()("@app/Jobs", { … }) {}.
The priority (N-level lane) peer of Tag — same WorkPool, with laneCount /
namedLanes priority lanes and add(item, lane?). class Jobs extends
WorkPool.priority<Jobs>()("@app/Jobs", { payload, laneCount: 2 }) {}. The class is the Tag —
yield* Jobs resolves the handle, layer provides it and serve exposes it over RPC
(both dispatch to the leveled engine for a priority tag). payload is the item schema; optional
success / error add the worker wire schemas.
export const const priority: <Self>() => {
<
F extends Schema.Struct.Fields,
Success extends Schema.Top,
HSelf
>(
key: string,
config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>
}
): NodeBoundTag<
Self,
PriorityInstanceSpec<F>,
HSelf
>
<
F extends Schema.Struct.Fields,
Success extends Schema.Top = Schema.Void
>(
key: string,
config: PriorityTagConfig<F, Success>
): HyperlinkTag<Self, PriorityInstanceSpec<F>>
}
Define an N-level managed queue as a named service
Tag
(also exported as
priority
): class Jobs extends WorkPool.priority<Jobs>()("@app/Jobs", { … }) {}.
The priority (N-level lane) peer of
Tag
— same WorkPool, with laneCount /
namedLanes priority lanes and add(item, lane?). class Jobs extends
WorkPool.priority<Jobs>()("@app/Jobs", { payload, laneCount: 2 }) {}. The class is the Tag —
yield* Jobs resolves the handle,
layer
provides it and
serve
exposes it over RPC
(both dispatch to the leveled engine for a priority tag). payload is the item schema; optional
success / error add the worker wire schemas.
priority = <function (type parameter) Self in <Self>(): {
<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>;
<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>;
}
Self>() => {
function function (local function) build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf> (+1 overload)
build<
function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>
F extends import SchemaSchema.Struct.type Struct<Fields extends Struct.Fields>.Fields = {
readonly [x: string]: Schema.Constraint;
readonly [x: number]: Schema.Constraint;
readonly [x: symbol]: Schema.Constraint;
}
Constraint for a struct field map: an object whose values are schemas.
Fields,
function (type parameter) Success in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>
Success extends import SchemaSchema.Top,
function (type parameter) HSelf in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>
HSelf,
>(
key: stringkey: string,
config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>
}
config: interface PriorityTagConfig<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>WorkPool.priority tag config — config object only (no positional schemas). payload is the
item schema; laneCount is the number of priority lanes; namedLanes maps names → lane indices.
Optional success / error wire slots match
WorkPool.Tag
(stamped for engine + store).
PriorityTagConfig<function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>
F, function (type parameter) Success in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>
Success> & { readonly node: NodeKey<HSelf>(property) node: {
key: string;
Service: {
protocol: Context.Service.Shape<typeof RpcClient.Protocol>;
ping: Effect.Effect<number, NodeUnreachable>;
status: { readonly get: Effect.Effect<NodeStatusSnapshot, NodeUnreachable>; readonly changes: Stream.Stream<NodeStatusSnapshot, NodeUnreachable> };
logs: { readonly stream: Stream.Stream<LogEntry, NodeUnreachable>; readonly query: (options: { readonly limit: number }) => Effect.Effect<ReadonlyArray<LogEntry>, NodeUnreachable> };
};
Identifier: Identifier;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
node: type NodeKey<HSelf> = Key<HSelf, NodeProtocol>The Context key of a
Node
(HSelf = its identity): a service whose value is the
transport
NodeProtocol
. Stored on a node-bearing tag under
nodeSym
; read by
Hyperlink.client
to resolve where to connect (its requirement channel).
NodeKey<function (type parameter) HSelf in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>
HSelf> },
): interface NodeBoundTag<Self, S extends Spec, HSelf, Svc = Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<...> : S[K] extends DefaultMethod<...> ? F : S[K] extends { ...; } ? SuccessOf<...> : S[K] extends { ...; } ? Subscribable<...> : S[K] extends { ...; } ? ClientMethod<...> : S[K] extends Spec ? Simplify<...> : never; }>>A
HyperlinkTag
bound to a concrete
Node
— its [nodeSym] narrowed to that node's
NodeKey<HSelf>, which is how
Hyperlink.client
discriminates the node-aware path. Returned
by the node-bearing tag constructors. It's a named type (not an inline & { [nodeSym] }) so a
consumer can export a node-bearing tag without leaking the internal symbol (TS4020).
NodeBoundTag<function (type parameter) Self in <Self>(): {
<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>;
<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>;
}
Self, type PriorityInstanceSpec<F extends Schema.Struct.Fields> = Omit<{
add: Hyperlink.Method<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>, Schema.optional<Schema.Schema<string | number>>]>, Schema.Void, Schema.Never, false, Hyperlink.MethodAnnotations & {
readonly callStyle: "pair";
} & {
description: string;
}, Hyperlink.Derive>;
enqueue: Hyperlink.Method<Schema.$Array<Schema.Struct<{
readonly item: Schema.Struct<F>;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
... 7 more ...;
readonly attributes: Schema.optional<...>;
}>>, ... 4 more ..., Hyperlink.Derive>;
... 14 more ...;
metrics: {
...;
};
}, "add"> & {
...;
}
Full priority-queue instance contract for itemSchema F.
PriorityInstanceSpec<function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>
F>, function (type parameter) HSelf in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>
HSelf>;
function function (local function) build<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>> (+1 overload)build<
function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>F extends import SchemaSchema.Struct.type Struct<Fields extends Struct.Fields>.Fields = {
readonly [x: string]: Schema.Constraint;
readonly [x: number]: Schema.Constraint;
readonly [x: symbol]: Schema.Constraint;
}
Constraint for a struct field map: an object whose values are schemas.
Fields,
function (type parameter) Success in build<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>Success extends import SchemaSchema.Top = typeof import SchemaSchema.const Void: Voidconst Void: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<void, readonly []>) => Schema.Void;
annotateKey: (annotations: Schema.Annotations.Key<void>) => Schema.Void;
check: (checks_0: Check<void>, ...checks: Array<Check<void>>) => Schema.Void;
rebuild: (ast: Void) => Schema.Void;
make: (input: void, options?: MakeOptions) => void;
makeOption: (input: void, options?: MakeOptions) => Option_.Option<void>;
makeEffect: (input: void, options?: MakeOptions) => Effect.Effect<void, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
Void
.
Schema for a TypeScript void return value.
When to use
Use when you need to model the return value of a function, RPC, or endpoint
whose result is intentionally ignored.
Details
Runtime parsing accepts any present value and discards it, producing
undefined. The public decoded and encoded TypeScript representation remains
void, so typed construction, decoding, and encoding APIs are still modeled
as void.
Void,
>(
key: stringkey: string,
config: PriorityTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
laneCount: number;
namedLanes: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config: interface PriorityTagConfig<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>WorkPool.priority tag config — config object only (no positional schemas). payload is the
item schema; laneCount is the number of priority lanes; namedLanes maps names → lane indices.
Optional success / error wire slots match
WorkPool.Tag
(stamped for engine + store).
PriorityTagConfig<function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>F, function (type parameter) Success in build<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>Success>,
): interface HyperlinkTag<Self, S extends Spec, Svc = Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<...> : S[K] extends DefaultMethod<...> ? F : S[K] extends { ...; } ? SuccessOf<...> : S[K] extends { ...; } ? Subscribable<...> : S[K] extends { ...; } ? ClientMethod<...> : S[K] extends Spec ? Simplify<...> : never; }>>The type of a HyperService tag carrying spec S — what
Hyperlink.Tag
produces
(and what you extend). Lets a consumer write
<S extends Spec>(tag: HyperlinkTag<Self, S>) and read the spec through named types
(
specOf
/
groupOf
) instead of a Parameters<typeof specOf> workaround.
HyperlinkTag<function (type parameter) Self in <Self>(): {
<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>;
<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>;
}
Self, type PriorityInstanceSpec<F extends Schema.Struct.Fields> = Omit<{
add: Hyperlink.Method<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>, Schema.optional<Schema.Schema<string | number>>]>, Schema.Void, Schema.Never, false, Hyperlink.MethodAnnotations & {
readonly callStyle: "pair";
} & {
description: string;
}, Hyperlink.Derive>;
enqueue: Hyperlink.Method<Schema.$Array<Schema.Struct<{
readonly item: Schema.Struct<F>;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
... 7 more ...;
readonly attributes: Schema.optional<...>;
}>>, ... 4 more ..., Hyperlink.Derive>;
... 14 more ...;
metrics: {
...;
};
}, "add"> & {
...;
}
Full priority-queue instance contract for itemSchema F.
PriorityInstanceSpec<function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>F>>;
function function (local function) build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf> (+1 overload)
build<function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>F extends import SchemaSchema.Struct.type Struct<Fields extends Struct.Fields>.Fields = {
readonly [x: string]: Schema.Constraint;
readonly [x: number]: Schema.Constraint;
readonly [x: symbol]: Schema.Constraint;
}
Constraint for a struct field map: an object whose values are schemas.
Fields, function (type parameter) Success in build<F extends Schema.Struct.Fields, Success extends Schema.Top>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>Success extends import SchemaSchema.Top>(
key: stringkey: string,
config: PriorityTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
laneCount: number;
namedLanes: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config: interface PriorityTagConfig<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>WorkPool.priority tag config — config object only (no positional schemas). payload is the
item schema; laneCount is the number of priority lanes; namedLanes maps names → lane indices.
Optional success / error wire slots match
WorkPool.Tag
(stamped for engine + store).
PriorityTagConfig<function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>F, function (type parameter) Success in build<F extends Schema.Struct.Fields, Success extends Schema.Top>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>Success>,
): interface HyperlinkTag<Self, S extends Spec, Svc = Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<...> : S[K] extends DefaultMethod<...> ? F : S[K] extends { ...; } ? SuccessOf<...> : S[K] extends { ...; } ? Subscribable<...> : S[K] extends { ...; } ? ClientMethod<...> : S[K] extends Spec ? Simplify<...> : never; }>>The type of a HyperService tag carrying spec S — what
Hyperlink.Tag
produces
(and what you extend). Lets a consumer write
<S extends Spec>(tag: HyperlinkTag<Self, S>) and read the spec through named types
(
specOf
/
groupOf
) instead of a Parameters<typeof specOf> workaround.
HyperlinkTag<function (type parameter) Self in <Self>(): {
<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>;
<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>;
}
Self, type PriorityInstanceSpec<F extends Schema.Struct.Fields> = Omit<{
add: Hyperlink.Method<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>, Schema.optional<Schema.Schema<string | number>>]>, Schema.Void, Schema.Never, false, Hyperlink.MethodAnnotations & {
readonly callStyle: "pair";
} & {
description: string;
}, Hyperlink.Derive>;
enqueue: Hyperlink.Method<Schema.$Array<Schema.Struct<{
readonly item: Schema.Struct<F>;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
... 7 more ...;
readonly attributes: Schema.optional<...>;
}>>, ... 4 more ..., Hyperlink.Derive>;
... 14 more ...;
metrics: {
...;
};
}, "add"> & {
...;
}
Full priority-queue instance contract for itemSchema F.
PriorityInstanceSpec<function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>F>> {
const const laneConfig: WorkPoolPriorityLaneConfigconst laneConfig: {
laneCount: number;
namedLanes: Record<string, number>;
defaultLevel: number;
}
laneConfig: type PriorityTagLaneConfig =
WorkPoolPriorityLaneConfig
Lane config for a priority queue tag.
PriorityTagLaneConfig = {
WorkPoolPriorityLaneConfig.laneCount: numberRequired lane count — one bounded queue per level index 0 … laneCount - 1.
laneCount: config: PriorityTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
laneCount: number;
namedLanes: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.PriorityTagConfig<F, Success>.laneCount: numberlaneCount,
WorkPoolPriorityLaneConfig.namedLanes?: Record<string, number> | undefinedMap configured names to lane indices (e.g. { interactive: 2, batch: 5 }).
namedLanes: config: PriorityTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
laneCount: number;
namedLanes: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.PriorityTagConfig<F, Success>.namedLanes?: Readonly<Record<string, number>> | undefinednamedLanes ?? {},
};
const const wire: {
success: Success | undefined
error: Schema.Top | undefined
}
wire = { success: Success | undefinedsuccess: config: PriorityTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
laneCount: number;
namedLanes: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.PriorityTagConfig<F, Success>.success?: Success | undefinedsuccess, error: Schema.Top | undefinederror: config: PriorityTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
laneCount: number;
namedLanes: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.PriorityTagConfig<F, Success>.error?: Schema.Toperror };
const const spec: PriorityInstanceSpec<F>spec = assertPriorityInstanceSpec<F extends Schema.Struct.Fields>(wired: unknown, baseline: unknown, wire?: QueueWire): PriorityInstanceSpec<F>Validate a wired priority-queue spec against its erased baseline.
assertPriorityInstanceSpec<function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>F>(
const prioritySpec: <F>(itemSchema: Schema.Struct<F>, laneConfig: WorkPoolPriorityLaneConfig, wire?: {
readonly success?: Schema.Top;
readonly error?: Schema.Top;
}) => {
add: Hyperlink.Method<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>, Schema.optional<Schema.Schema<string | number>>]>, Schema.Void, Schema.Never, false, Hyperlink.MethodAnnotations & {
readonly callStyle: "pair";
} & {
description: string;
}, Hyperlink.Derive>;
... 15 more ...;
metrics: {
...;
};
}
Build a priority-queue instance spec: shared
priorityControlSpec
plus
per-instance data-plane procedures typed by itemSchema.
prioritySpec(config: PriorityTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
laneCount: number;
namedLanes: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.PriorityTagConfig<F, Success>.payload: Schema.Struct<F>(property) PriorityTagConfig<F, Success>.payload: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Struct.MakeInView<F, Struct.TypeOptionalKeys<F> | Struct.TypeConstructorDefaultedKeys<F>>, options?: MakeOptions) => Struct.View<F, 'Type', Struct.TypeOptionalKeys<F>, Struct.TypeMutableKeys<F>>;
makeOption: (input: Struct.MakeInView<F, Struct.TypeOptionalKeys<F> | Struct.TypeConstructorDefaultedKeys<F>>, options?: MakeOptions) => Option_.Option<Struct.View<F, 'Type', Struct.TypeOptionalKeys<F>, Struct.TypeMutableKeys<F>>>;
makeEffect: (input: Struct.MakeInView<F, Struct.TypeOptionalKeys<F> | Struct.TypeConstructorDefaultedKeys<F>>, options?: MakeOptions) => Effect.Effect<Struct.View<F, 'Type', Struct.TypeOptionalKeys<F>, Struct.TypeMutableKeys<F>>, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
payload, const laneConfig: WorkPoolPriorityLaneConfigconst laneConfig: {
laneCount: number;
namedLanes: Record<string, number>;
defaultLevel: number;
}
laneConfig, const wire: {
success: Success | undefined
error: Schema.Top | undefined
}
wire),
const prioritySpec: <F>(itemSchema: Schema.Struct<F>, laneConfig: WorkPoolPriorityLaneConfig, wire?: {
readonly success?: Schema.Top;
readonly error?: Schema.Top;
}) => {
add: Hyperlink.Method<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>, Schema.optional<Schema.Schema<string | number>>]>, Schema.Void, Schema.Never, false, Hyperlink.MethodAnnotations & {
readonly callStyle: "pair";
} & {
description: string;
}, Hyperlink.Derive>;
... 15 more ...;
metrics: {
...;
};
}
Build a priority-queue instance spec: shared
priorityControlSpec
plus
per-instance data-plane procedures typed by itemSchema.
prioritySpec(config: PriorityTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
laneCount: number;
namedLanes: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.PriorityTagConfig<F, Success>.payload: Schema.Struct<F>(property) PriorityTagConfig<F, Success>.payload: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Struct.MakeInView<F, Struct.TypeOptionalKeys<F> | Struct.TypeConstructorDefaultedKeys<F>>, options?: MakeOptions) => Struct.View<F, 'Type', Struct.TypeOptionalKeys<F>, Struct.TypeMutableKeys<F>>;
makeOption: (input: Struct.MakeInView<F, Struct.TypeOptionalKeys<F> | Struct.TypeConstructorDefaultedKeys<F>>, options?: MakeOptions) => Option_.Option<Struct.View<F, 'Type', Struct.TypeOptionalKeys<F>, Struct.TypeMutableKeys<F>>>;
makeEffect: (input: Struct.MakeInView<F, Struct.TypeOptionalKeys<F> | Struct.TypeConstructorDefaultedKeys<F>>, options?: MakeOptions) => Effect.Effect<Struct.View<F, 'Type', Struct.TypeOptionalKeys<F>, Struct.TypeMutableKeys<F>>, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
payload, const laneConfig: WorkPoolPriorityLaneConfigconst laneConfig: {
laneCount: number;
namedLanes: Record<string, number>;
defaultLevel: number;
}
laneConfig),
const wire: {
success: Success | undefined
error: Schema.Top | undefined
}
wire,
);
const const base: Hyperlink.HyperlinkTag<Self, Omit<{
add: Hyperlink.Method<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>, Schema.optional<Schema.Schema<string | number>>]>, Schema.Void, Schema.Never, false, Hyperlink.MethodAnnotations & {
readonly callStyle: "pair";
} & {
description: string;
}, Hyperlink.Derive>;
enqueue: Hyperlink.Method<Schema.$Array<Schema.Struct<{
readonly item: Schema.Struct<F>;
readonly entryId: Schema.String;
... 8 more ...;
readonly attributes: Schema.optional<...>;
}>>, ... 4 more ..., Hyperlink.Derive>;
... 14 more ...;
metrics: {
...;
};
}, "add"> & {
...;
}, {
...;
}>
const base: {
key: Identifier;
Service: {
enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; timestamps: { readonly enqueuedAt: …;
release: (payload: { options?: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined } | undefined }) => Effect.Effect<ReadonlyArray<{ readonly i…;
releaseEncoded: (payload: { options?: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined } | undefined }) => Effect.Effect<ReadonlyArray<{ readonly p…;
deadLetter: (payload: { selector: { readonly key?: string | undefined; readonly item?: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | undefined; readonly entryId?: string | undefined }; options: { …;
drop: (payload: { selector: { readonly key?: string | undefined; readonly item?: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | undefined; readonly entryId?: string | undefined }; options: { …;
events: Stream.Stream<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Start'>; readonly key: Schema.String }, 'Type'> | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Sch…;
status: Hyperlink.Subscribable<Schema.Struct.ReadonlySide<{ readonly sizes: Schema.$Record<Schema.String, Schema.Number>; readonly paused: Schema.Boolean; readonly inFlight: Schema.Number; readonly completed: Schema.Number; readonly phase: Schema.…;
size: Hyperlink.Subscribable<number>;
isEmpty: Hyperlink.Subscribable<boolean>;
levelSizes: Effect.Effect<ReadonlyArray<number>, never, never>;
start: Effect.Effect<void, never, never>;
pause: Effect.Effect<void, never, never>;
resume: Effect.Effect<void, never, never>;
shutdown: Effect.Effect<void, never, never>;
clear: Effect.Effect<number, never, never>;
metrics: { readonly stream: Stream.Stream<{ readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined }; readonly win…;
add: (arg0: unknown, arg1?: unknown) => Effect.Effect<void, never, never>;
};
description: string | undefined;
of: (this: void, self: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: numb…;
context: (self: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; timestam…;
use: (f: (service: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; t…;
useSync: (f: (service: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; t…;
Identifier: Identifier;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
base =
config: PriorityTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
laneCount: number;
namedLanes: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.PriorityTagConfig<F extends Schema.Struct.Fields, Success extends Schema.Top = Void>.node?: NodeKey<unknown>node === var undefinedundefined
? import HyperlinkHyperlink.Tag<Self>(): SchemaTagBuilder<Self> (+2 overloads)
export Tag
Schema-driven solo: infer the service from spec; bare
local
is a compile error.
Tag<function (type parameter) Self in <Self>(): {
<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>;
<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>;
}
Self>()(key: stringkey, const spec: PriorityInstanceSpec<F>spec, { description?: string | undefineddescription: config: PriorityTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
laneCount: number;
namedLanes: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.PriorityTagConfig<F, Success>.description?: string | undefineddescription, kind?: string | undefinedkind: const priorityKind: "hyperlink-ts/WorkPool/priority"This contract's canonical kind — stamped on every tag so consumers (e.g. the dashboard) can
classify it via
Hyperlink.kindOf
without sniffing the spec.
priorityKind })
: import HyperlinkHyperlink.Tag<Self>(): SchemaTagBuilder<Self> (+2 overloads)
export Tag
Schema-driven solo: infer the service from spec; bare
local
is a compile error.
Tag<function (type parameter) Self in <Self>(): {
<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf>;
<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: PriorityTagConfig<F, Success>): HyperlinkTag<Self, PriorityInstanceSpec<F>>;
}
Self>()(key: stringkey, const spec: PriorityInstanceSpec<F>spec, {
description?: string | undefineddescription: config: PriorityTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
laneCount: number;
namedLanes: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.PriorityTagConfig<F, Success>.description?: string | undefineddescription,
kind?: string | undefinedkind: const priorityKind: "hyperlink-ts/WorkPool/priority"This contract's canonical kind — stamped on every tag so consumers (e.g. the dashboard) can
classify it via
Hyperlink.kindOf
without sniffing the spec.
priorityKind,
node: NodeKey<unknown>(property) node: {
key: string;
Service: {
protocol: Context.Service.Shape<typeof RpcClient.Protocol>;
ping: Effect.Effect<number, NodeUnreachable>;
status: { readonly get: Effect.Effect<NodeStatusSnapshot, NodeUnreachable>; readonly changes: Stream.Stream<NodeStatusSnapshot, NodeUnreachable> };
logs: { readonly stream: Stream.Stream<LogEntry, NodeUnreachable>; readonly query: (options: { readonly limit: number }) => Effect.Effect<ReadonlyArray<LogEntry>, NodeUnreachable> };
};
Identifier: Identifier;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
node: config: PriorityTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
laneCount: number;
namedLanes: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.PriorityTagConfig<F extends Schema.Struct.Fields, Success extends Schema.Top = Void>.node?: NodeKey<unknown>(property) PriorityTagConfig<F extends Schema.Struct.Fields, Success extends Schema.Top = Void>.node?: {
key: string;
Service: {
protocol: Context.Service.Shape<typeof RpcClient.Protocol>;
ping: Effect.Effect<number, NodeUnreachable>;
status: { readonly get: Effect.Effect<NodeStatusSnapshot, NodeUnreachable>; readonly changes: Stream.Stream<NodeStatusSnapshot, NodeUnreachable> };
logs: { readonly stream: Stream.Stream<LogEntry, NodeUnreachable>; readonly query: (options: { readonly limit: number }) => Effect.Effect<ReadonlyArray<LogEntry>, NodeUnreachable> };
};
Identifier: Identifier;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
node,
});
const const ready: Hyperlink.HyperlinkTag<Self, Omit<{
add: Hyperlink.Method<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>, Schema.optional<Schema.Schema<string | number>>]>, Schema.Void, Schema.Never, false, Hyperlink.MethodAnnotations & {
readonly callStyle: "pair";
} & {
description: string;
}, Hyperlink.Derive>;
enqueue: Hyperlink.Method<Schema.$Array<Schema.Struct<{
readonly item: Schema.Struct<F>;
readonly entryId: Schema.String;
... 8 more ...;
readonly attributes: Schema.optional<...>;
}>>, ... 4 more ..., Hyperlink.Derive>;
... 14 more ...;
metrics: {
...;
};
}, "add"> & {
...;
}, {
...;
}>
const ready: {
key: Identifier;
Service: {
enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; timestamps: { readonly enqueuedAt: …;
release: (payload: { options?: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined } | undefined }) => Effect.Effect<ReadonlyArray<{ readonly i…;
releaseEncoded: (payload: { options?: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined } | undefined }) => Effect.Effect<ReadonlyArray<{ readonly p…;
deadLetter: (payload: { selector: { readonly key?: string | undefined; readonly item?: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | undefined; readonly entryId?: string | undefined }; options: { …;
drop: (payload: { selector: { readonly key?: string | undefined; readonly item?: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | undefined; readonly entryId?: string | undefined }; options: { …;
events: Stream.Stream<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Start'>; readonly key: Schema.String }, 'Type'> | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Sch…;
status: Hyperlink.Subscribable<Schema.Struct.ReadonlySide<{ readonly sizes: Schema.$Record<Schema.String, Schema.Number>; readonly paused: Schema.Boolean; readonly inFlight: Schema.Number; readonly completed: Schema.Number; readonly phase: Schema.…;
size: Hyperlink.Subscribable<number>;
isEmpty: Hyperlink.Subscribable<boolean>;
levelSizes: Effect.Effect<ReadonlyArray<number>, never, never>;
start: Effect.Effect<void, never, never>;
pause: Effect.Effect<void, never, never>;
resume: Effect.Effect<void, never, never>;
shutdown: Effect.Effect<void, never, never>;
clear: Effect.Effect<number, never, never>;
metrics: { readonly stream: Stream.Stream<{ readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined }; readonly win…;
add: (arg0: unknown, arg1?: unknown) => Effect.Effect<void, never, never>;
};
description: string | undefined;
of: (this: void, self: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: numb…;
context: (self: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; timestam…;
use: (f: (service: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; t…;
useSync: (f: (service: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; t…;
Identifier: Identifier;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
ready = import HyperlinkHyperlink.const withReadiness: {
<T extends PipeableTag>(
readiness: ReadinessOf<
T extends HyperlinkTag<
any,
infer S extends Spec
>
? ServiceOf<S, any>
: never
>
): (tag: T) => T
<Self, S extends Spec, HSelf>(
tag: NodeBoundTag<Self, S, HSelf>,
readiness: ReadinessOf<ServiceOf<S, Self>>
): NodeBoundTag<Self, S, HSelf>
<Self, S extends Spec>(
tag: HyperlinkTag<Self, S>,
readiness: ReadinessOf<ServiceOf<S, Self>>
): HyperlinkTag<Self, S>
}
withReadiness(const base: Hyperlink.HyperlinkTag<Self, Omit<{
add: Hyperlink.Method<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>, Schema.optional<Schema.Schema<string | number>>]>, Schema.Void, Schema.Never, false, Hyperlink.MethodAnnotations & {
readonly callStyle: "pair";
} & {
description: string;
}, Hyperlink.Derive>;
enqueue: Hyperlink.Method<Schema.$Array<Schema.Struct<{
readonly item: Schema.Struct<F>;
readonly entryId: Schema.String;
... 8 more ...;
readonly attributes: Schema.optional<...>;
}>>, ... 4 more ..., Hyperlink.Derive>;
... 14 more ...;
metrics: {
...;
};
}, "add"> & {
...;
}, {
...;
}>
const base: {
key: Identifier;
Service: {
enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; timestamps: { readonly enqueuedAt: …;
release: (payload: { options?: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined } | undefined }) => Effect.Effect<ReadonlyArray<{ readonly i…;
releaseEncoded: (payload: { options?: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined } | undefined }) => Effect.Effect<ReadonlyArray<{ readonly p…;
deadLetter: (payload: { selector: { readonly key?: string | undefined; readonly item?: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | undefined; readonly entryId?: string | undefined }; options: { …;
drop: (payload: { selector: { readonly key?: string | undefined; readonly item?: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | undefined; readonly entryId?: string | undefined }; options: { …;
events: Stream.Stream<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Start'>; readonly key: Schema.String }, 'Type'> | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Sch…;
status: Hyperlink.Subscribable<Schema.Struct.ReadonlySide<{ readonly sizes: Schema.$Record<Schema.String, Schema.Number>; readonly paused: Schema.Boolean; readonly inFlight: Schema.Number; readonly completed: Schema.Number; readonly phase: Schema.…;
size: Hyperlink.Subscribable<number>;
isEmpty: Hyperlink.Subscribable<boolean>;
levelSizes: Effect.Effect<ReadonlyArray<number>, never, never>;
start: Effect.Effect<void, never, never>;
pause: Effect.Effect<void, never, never>;
resume: Effect.Effect<void, never, never>;
shutdown: Effect.Effect<void, never, never>;
clear: Effect.Effect<number, never, never>;
metrics: { readonly stream: Stream.Stream<{ readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined }; readonly win…;
add: (arg0: unknown, arg1?: unknown) => Effect.Effect<void, never, never>;
};
description: string | undefined;
of: (this: void, self: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: numb…;
context: (self: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; timestam…;
use: (f: (service: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; t…;
useSync: (f: (service: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; t…;
Identifier: Identifier;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
base, (svc: {
...;
}
svc) =>
import EffectEffect.const map: {
<A, B>(f: (a: A) => B): <E, R>(
self: Effect<A, E, R>
) => Effect<B, E, R>
<A, E, R, B>(
self: Effect<A, E, R>,
f: (a: A) => B
): Effect<B, E, R>
}
Transforms the value inside an effect by applying a function to it.
When to use
Use to transform an effect's success value with a function that returns a
plain value, producing a new effect without changing the original effect's
typed error or context requirements.
Details
map takes a function and applies it to the value contained within an
effect, creating a new effect with the transformed value.
It's important to note that effects are immutable, meaning that the original
effect is not modified. Instead, a new effect is returned with the updated
value.
Example (Choosing map syntax variants)
import { Effect, pipe } from "effect"
const myEffect = Effect.succeed(1)
const transformation = (n: number) => n + 1
const mappedWithPipe = pipe(myEffect, Effect.map(transformation))
const mappedWithDataFirst = Effect.map(myEffect, transformation)
const mappedWithMethod = myEffect.pipe(Effect.map(transformation))
Example (Adding a service charge)
import { Effect, pipe } from "effect"
const addServiceCharge = (amount: number) => amount + 1
const fetchTransactionAmount = Effect.promise(() => Promise.resolve(100))
const finalAmount = pipe(
fetchTransactionAmount,
Effect.map(addServiceCharge)
)
Effect.runPromise(finalAmount).then(console.log)
// Output: 101
map(svc: {
...;
}
svc.status: Hyperlink.Subscribable<
Schema.Struct.ReadonlySide<
{
readonly sizes: Schema.$Record<
Schema.String,
Schema.Number
>
readonly paused: Schema.Boolean
readonly inFlight: Schema.Number
readonly completed: Schema.Number
readonly phase: Schema.Literals<
readonly ["running", "draining", "off"]
>
},
"Type"
>
>
(property) status: {
get: Effect.Effect<A>;
changes: Stream.Stream<A>;
}
status.Subscribable<Struct<Fields extends Struct.Fields>.ReadonlySide<{ readonly sizes: $Record<String, Number>; readonly paused: Boolean; readonly inFlight: Number; readonly completed: Number; readonly phase: Literals<...>; }, "Type">>.get: Effect.Effect<A>(property) Subscribable<Struct<Fields extends Struct.Fields>.ReadonlySide<{ readonly sizes: $Record<String, Number>; readonly paused: Boolean; readonly inFlight: Number; readonly completed: Number; readonly phase: Literals<...>; }, "Type">>.get: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
get, (status: Schema.Struct.ReadonlySide<
{
readonly sizes: Schema.$Record<
Schema.String,
Schema.Number
>
readonly paused: Schema.Boolean
readonly inFlight: Schema.Number
readonly completed: Schema.Number
readonly phase: Schema.Literals<
readonly ["running", "draining", "off"]
>
},
"Type"
>
(parameter) status: {
sizes: { readonly [x: string]: number };
paused: boolean;
inFlight: number;
completed: number;
phase: 'running' | 'draining' | 'off';
}
status) => ({
ready: booleanready: status: Schema.Struct.ReadonlySide<
{
readonly sizes: Schema.$Record<
Schema.String,
Schema.Number
>
readonly paused: Schema.Boolean
readonly inFlight: Schema.Number
readonly completed: Schema.Number
readonly phase: Schema.Literals<
readonly ["running", "draining", "off"]
>
},
"Type"
>
(parameter) status: {
sizes: { readonly [x: string]: number };
paused: boolean;
inFlight: number;
completed: number;
phase: 'running' | 'draining' | 'off';
}
status.phase: "running" | "draining" | "off"phase === "running",
...(status: Schema.Struct.ReadonlySide<
{
readonly sizes: Schema.$Record<
Schema.String,
Schema.Number
>
readonly paused: Schema.Boolean
readonly inFlight: Schema.Number
readonly completed: Schema.Number
readonly phase: Schema.Literals<
readonly ["running", "draining", "off"]
>
},
"Type"
>
(parameter) status: {
sizes: { readonly [x: string]: number };
paused: boolean;
inFlight: number;
completed: number;
phase: 'running' | 'draining' | 'off';
}
status.phase: "running" | "draining" | "off"phase === "running"
? {}
: { detail?: string | undefineddetail: `phase: ${status: Schema.Struct.ReadonlySide<
{
readonly sizes: Schema.$Record<
Schema.String,
Schema.Number
>
readonly paused: Schema.Boolean
readonly inFlight: Schema.Number
readonly completed: Schema.Number
readonly phase: Schema.Literals<
readonly ["running", "draining", "off"]
>
},
"Type"
>
(parameter) status: {
sizes: { readonly [x: string]: number };
paused: boolean;
inFlight: number;
completed: number;
phase: 'running' | 'draining' | 'off';
}
status.phase: "draining" | "off"phase}` }),
})),
);
return stampQueueWireSchemas<T extends object>(tag: T, schemas: { readonly success?: Schema.Top; readonly error?: Schema.Top }): TStamp success / error wire schemas onto a queue-family tag.
stampQueueWireSchemas(const ready: Hyperlink.HyperlinkTag<Self, Omit<{
add: Hyperlink.Method<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Struct<F>, Schema.$Array<Schema.Struct<F>>]>, Schema.optional<Schema.Schema<string | number>>]>, Schema.Void, Schema.Never, false, Hyperlink.MethodAnnotations & {
readonly callStyle: "pair";
} & {
description: string;
}, Hyperlink.Derive>;
enqueue: Hyperlink.Method<Schema.$Array<Schema.Struct<{
readonly item: Schema.Struct<F>;
readonly entryId: Schema.String;
... 8 more ...;
readonly attributes: Schema.optional<...>;
}>>, ... 4 more ..., Hyperlink.Derive>;
... 14 more ...;
metrics: {
...;
};
}, "add"> & {
...;
}, {
...;
}>
const ready: {
key: Identifier;
Service: {
enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; timestamps: { readonly enqueuedAt: …;
release: (payload: { options?: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined } | undefined }) => Effect.Effect<ReadonlyArray<{ readonly i…;
releaseEncoded: (payload: { options?: { readonly releaseId?: string | undefined; readonly attributes?: { readonly [x: string]: JsonValue } | undefined; readonly scope?: 'pendingOnly' | undefined } | undefined }) => Effect.Effect<ReadonlyArray<{ readonly p…;
deadLetter: (payload: { selector: { readonly key?: string | undefined; readonly item?: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | undefined; readonly entryId?: string | undefined }; options: { …;
drop: (payload: { selector: { readonly key?: string | undefined; readonly item?: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>> | undefined; readonly entryId?: string | undefined }; options: { …;
events: Stream.Stream<Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Start'>; readonly key: Schema.String }, 'Type'> | { readonly entries: ReadonlyArray<{ readonly item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Sch…;
status: Hyperlink.Subscribable<Schema.Struct.ReadonlySide<{ readonly sizes: Schema.$Record<Schema.String, Schema.Number>; readonly paused: Schema.Boolean; readonly inFlight: Schema.Number; readonly completed: Schema.Number; readonly phase: Schema.…;
size: Hyperlink.Subscribable<number>;
isEmpty: Hyperlink.Subscribable<boolean>;
levelSizes: Effect.Effect<ReadonlyArray<number>, never, never>;
start: Effect.Effect<void, never, never>;
pause: Effect.Effect<void, never, never>;
resume: Effect.Effect<void, never, never>;
shutdown: Effect.Effect<void, never, never>;
clear: Effect.Effect<number, never, never>;
metrics: { readonly stream: Stream.Stream<{ readonly inFlight: number; readonly completed: number; readonly avgWaitMillis: { readonly high?: number | undefined; readonly normal?: number | undefined; readonly low?: number | undefined }; readonly win…;
add: (arg0: unknown, arg1?: unknown) => Effect.Effect<void, never, never>;
};
description: string | undefined;
of: (this: void, self: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: numb…;
context: (self: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; timestam…;
use: (f: (service: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; t…;
useSync: (f: (service: { readonly enqueue: (payload: ReadonlyArray<{ item: Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>; entryId: string; priority: 'high' | 'normal' | 'low'; attempts: number; t…;
Identifier: Identifier;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
ready, {
success?: Schema.Top | undefinedsuccess: config: PriorityTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
laneCount: number;
namedLanes: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.PriorityTagConfig<F, Success>.success?: Success | undefinedsuccess,
error?: Schema.Top | undefinederror: config: PriorityTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
laneCount: number;
namedLanes: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.PriorityTagConfig<F, Success>.error?: Schema.Toperror,
});
}
return function (local function) build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: PriorityTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, PriorityInstanceSpec<F>, HSelf> (+1 overload)
build;
};