<Self>(): ProcessTagBuild<Self>Define a managed process as a toolkit resource. Self is given explicitly (Effect's ()
two-stage form). The base tag carries observation + lifecycle; add a schedule with
.pipe(schedule(…)). Declare value/error wire schemas on the tag:
class Health extends Process.Tag<Health>()("app/Health") {}
class Prices extends Process.Tag<Prices>()("app/Prices", PriceSchema) {}
class PricesE extends Process.Tag<PricesE>()("app/Prices", PriceSchema, FetchErr) {}
class PricesCfg extends Process.Tag<PricesCfg>()("app/Prices", {
success: PriceSchema,
error: FetchErr,
}) {}Pass options.node to bind the process to a Node.Tag.
export const const Tag: <
Self
>() => ProcessTagBuild<Self>
Define a managed process as a toolkit resource. Self is given explicitly (Effect's ()
two-stage form). The base tag carries observation + lifecycle; add a schedule with
.pipe(
schedule
(…)). Declare value/error wire schemas on the tag:
class Health extends Process.Tag<Health>()("app/Health") {}
class Prices extends Process.Tag<Prices>()("app/Prices", PriceSchema) {}
class PricesE extends Process.Tag<PricesE>()("app/Prices", PriceSchema, FetchErr) {}
class PricesCfg extends Process.Tag<PricesCfg>()("app/Prices", {
success: PriceSchema,
error: FetchErr,
}) {}
Pass options.node to bind the process to a
Node.Tag
.
Tag = <function (type parameter) Self in <Self>(): ProcessTagBuild<Self>Self>() => {
function function (local function) build(key: string, second?: Schema.Top | ProcessTagOptions, third?: Schema.Top): HyperlinkTag<Self, ProcessSpec> | NodeBoundTag<Self, ProcessSpec, unknown>build(
key: stringkey: string,
second: Schema.Top | ProcessTagOptionssecond?: import SchemaSchema.Top | type ProcessTagOptions = {
readonly description?: string
readonly success?: Schema.Top
readonly error?: Schema.Top
readonly node?: NodeKey<unknown>
}
Options for
Tag
— use as the sole 2nd argument (config-object overload) or merge with
positional success / error args.
ProcessTagOptions,
third: Schema.Top | undefinedthird?: import SchemaSchema.Top,
): import HyperlinkTagHyperlinkTag<function (type parameter) Self in <Self>(): ProcessTagBuild<Self>Self, type ProcessSpec = {
events: any
run: any
status: any
start: any
stop: any
wake: any
resetCadence: any
}
The base (schedule-less, result-less) process spec.
ProcessSpec> | import NodeBoundTagNodeBoundTag<function (type parameter) Self in <Self>(): ProcessTagBuild<Self>Self, type ProcessSpec = {
events: any
run: any
status: any
start: any
stop: any
wake: any
resetCadence: any
}
The base (schedule-less, result-less) process spec.
ProcessSpec, unknown> {
if (second: Schema.Top | ProcessTagOptionssecond === var undefinedundefined) {
return const buildProcessTag: <Self>(
key: string,
options: ProcessTagOptions | undefined,
positional?: {
readonly success?: Schema.Top
readonly error?: Schema.Top
}
) =>
| HyperlinkTag<any, any, any>
| NodeBoundTag<any, any, unknown, any>
buildProcessTag<function (type parameter) Self in <Self>(): ProcessTagBuild<Self>Self>(key: stringkey, var undefinedundefined);
}
if (import SchemaSchema.function isSchema(
u: unknown
): u is Schema.Top
Checks whether a value is a Schema.
isSchema(second: Schema.Top | ProcessTagOptionssecond)) {
return const buildProcessTag: <Self>(
key: string,
options: ProcessTagOptions | undefined,
positional?: {
readonly success?: Schema.Top
readonly error?: Schema.Top
}
) =>
| HyperlinkTag<any, any, any>
| NodeBoundTag<any, any, unknown, any>
buildProcessTag<function (type parameter) Self in <Self>(): ProcessTagBuild<Self>Self>(key: stringkey, var undefinedundefined, {
success?: Schema.Top | undefined(property) success?: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<unknown, any>) => Schema.Top;
annotateKey: (annotations: Schema.Annotations.Key<unknown>) => Schema.Top;
check: (checks_0: Check<unknown>, ...checks: Array<Check<unknown>>) => Schema.Top;
rebuild: (ast: AST) => Schema.Top;
make: (input: unknown, options?: Schema.MakeOptions) => unknown;
makeOption: (input: unknown, options?: Schema.MakeOptions) => Option.Option<unknown>;
makeEffect: (input: unknown, options?: Schema.MakeOptions) => Effect.Effect<unknown, Schema.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; <…;
}
success: second: Schema.Top | ProcessTagOptions(parameter) second: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<unknown, any>) => Schema.Top;
annotateKey: (annotations: Schema.Annotations.Key<unknown>) => Schema.Top;
check: (checks_0: Check<unknown>, ...checks: Array<Check<unknown>>) => Schema.Top;
rebuild: (ast: AST) => Schema.Top;
make: (input: unknown, options?: Schema.MakeOptions) => unknown;
makeOption: (input: unknown, options?: Schema.MakeOptions) => Option.Option<unknown>;
makeEffect: (input: unknown, options?: Schema.MakeOptions) => Effect.Effect<unknown, Schema.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; <…;
}
second,
error?: Schema.Top | undefinederror: third: Schema.Top | undefinedthird,
});
}
if (const isProcessTagOptions: (
value: unknown
) => value is ProcessTagOptions
isProcessTagOptions(second: Schema.Top | ProcessTagOptions(parameter) second: {
description: string;
success: Schema.Top;
error: Schema.Top;
node: NodeKey<unknown>;
}
second)) {
return const buildProcessTag: <Self>(
key: string,
options: ProcessTagOptions | undefined,
positional?: {
readonly success?: Schema.Top
readonly error?: Schema.Top
}
) =>
| HyperlinkTag<any, any, any>
| NodeBoundTag<any, any, unknown, any>
buildProcessTag<function (type parameter) Self in <Self>(): ProcessTagBuild<Self>Self>(key: stringkey, second: Schema.Top | ProcessTagOptions(parameter) second: {
description: string;
success: Schema.Top;
error: Schema.Top;
node: NodeKey<unknown>;
}
second);
}
return const buildProcessTag: <Self>(
key: string,
options: ProcessTagOptions | undefined,
positional?: {
readonly success?: Schema.Top
readonly error?: Schema.Top
}
) =>
| HyperlinkTag<any, any, any>
| NodeBoundTag<any, any, unknown, any>
buildProcessTag<function (type parameter) Self in <Self>(): ProcessTagBuild<Self>Self>(key: stringkey, var undefinedundefined);
}
// The single, guarded cast: an overloaded *function* (`build`) isn't structurally assignable to a
// call-signature *object* type (`ProcessTagBuild<Self>`) even when it implements exactly those
// overloads — a known TS limitation (the same class as QueueHyperlink's `nameQueueService` cast).
// It's soundness-guarded: `process-built-resource` / `process-contract-shape` .test-d.ts exercise
// `Process.Tag()` in every form, so a drift between `build` and `ProcessTagBuild` fails the build.
return function (local function) build(key: string, second?: Schema.Top | ProcessTagOptions, third?: Schema.Top): HyperlinkTag<Self, ProcessSpec> | NodeBoundTag<Self, ProcessSpec, unknown>build as type ProcessTagBuild<Self> = {
(key: string): HyperlinkTag<
Self,
ProcessInstanceSpec
>
<A extends Schema.Top>(
key: string,
success: A
): HyperlinkTag<Self, ProcessInstanceSpec<A>>
<A extends Schema.Top, E extends Schema.Top>(
key: string,
success: A,
error: E
): HyperlinkTag<Self, ProcessInstanceSpec<A, E>>
<A extends Schema.Top>(
key: string,
options: ProcessTagOptions & {
readonly success: A
}
): HyperlinkTag<Self, ProcessInstanceSpec<A>>
<E extends Schema.Top>(
key: string,
options: ProcessTagOptions & {
readonly error: E
}
): HyperlinkTag<
Self,
ProcessInstanceSpec<typeof Schema.Void, E>
>
<A extends Schema.Top, E extends Schema.Top>(
key: string,
options: ProcessTagOptions & {
readonly success: A
readonly error: E
}
): HyperlinkTag<Self, ProcessInstanceSpec<A, E>>
<HSelf>(
key: string,
options: ProcessTagOptions & {
readonly node: NodeKey<HSelf>
}
): NodeBoundTag<
Self,
ProcessInstanceSpec,
HSelf
>
<A extends Schema.Top, HSelf>(
key: string,
options: ProcessTagOptions & {
readonly success: A
readonly node: NodeKey<HSelf>
}
): NodeBoundTag<
Self,
ProcessInstanceSpec<A>,
HSelf
>
(
key: string,
options?: ProcessTagOptions
): HyperlinkTag<Self, ProcessInstanceSpec>
}
Callable shape for
Tag
— overloads for positional schemas + config object.
ProcessTagBuild<function (type parameter) Self in <Self>(): ProcessTagBuild<Self>Self>;
};