(windows: ReadonlyArray<ScheduleWindow>): <Self, S extends Spec>(
tag: HyperlinkTag<Self, S>
) => HyperlinkTag<any, S & ScheduleGroupSpec>
(source: HyperlinkTag<any, ScheduleHyperlinkSpec>): <
Self,
S extends Spec
>(
tag: HyperlinkTag<Self, S>
) => HyperlinkTag<any, S>Attach a schedule to a process (pipeable). Two forms, distinguished by argument:
- inline windows — the process owns an in-memory schedule seeded with
windows, and its contract gains thescheduleverb group (entries/set/add/clear):
class Matches extends Process.Tag<Matches>()("app/Matches").pipe(
Process.schedule([Process.window(kickoff, final)]),
) {}- an external Schedule — the process is gated by a shared schedule resource and gains no schedule verbs (they live on the resource, which can arm many processes at once):
class IngestScores extends Process.Tag<IngestScores>()("app/IngestScores").pipe(
Process.schedule(SeasonSchedule),
) {}export function function schedule(windows: ReadonlyArray<ScheduleWindow>): <Self, S extends Spec>(tag: HyperlinkTag<Self, S>) => HyperlinkTag<any, S & ScheduleGroupSpec> (+1 overload)Attach a schedule to a process (pipeable). Two forms, distinguished by argument:
- inline windows — the process owns an in-memory schedule seeded with
windows, and its
contract gains the schedule verb group (entries / set / add / clear):
class Matches extends Process.Tag<Matches>()("app/Matches").pipe(
Process.schedule([Process.window(kickoff, final)]),
) {}
- **an external
Schedule
** — the process is gated by a shared schedule resource and
gains no schedule verbs (they live on the resource, which can arm many processes at once):
class IngestScores extends Process.Tag<IngestScores>()("app/IngestScores").pipe(
Process.schedule(SeasonSchedule),
) {}
schedule(
windows: ReadonlyArray<ScheduleWindow>windows: interface ReadonlyArray<T>ReadonlyArray<ScheduleWindow>,
): <function (type parameter) Self in <Self, S extends Spec>(tag: HyperlinkTag<Self, S>): HyperlinkTag<any, S & ScheduleGroupSpec>Self, function (type parameter) S in <Self, S extends Spec>(tag: HyperlinkTag<Self, S>): HyperlinkTag<any, S & ScheduleGroupSpec>S extends import SpecSpec>(tag: HyperlinkTag<Self, S>tag: import HyperlinkTagHyperlinkTag<function (type parameter) Self in <Self, S extends Spec>(tag: HyperlinkTag<Self, S>): HyperlinkTag<any, S & ScheduleGroupSpec>Self, function (type parameter) S in <Self, S extends Spec>(tag: HyperlinkTag<Self, S>): HyperlinkTag<any, S & ScheduleGroupSpec>S>) => import HyperlinkTagHyperlinkTag<any, function (type parameter) S in <Self, S extends Spec>(tag: HyperlinkTag<Self, S>): HyperlinkTag<any, S & ScheduleGroupSpec>S & type ScheduleGroupSpec = {
readonly schedule: typeof scheduleGroupSpec
}
The schedule group as a nested
Spec
fragment (what
schedule
's inline form grafts).
ScheduleGroupSpec>;
export function function schedule(source: HyperlinkTag<any, ScheduleHyperlinkSpec>): <Self, S extends Spec>(tag: HyperlinkTag<Self, S>) => HyperlinkTag<any, S> (+1 overload)Attach a schedule to a process (pipeable). Two forms, distinguished by argument:
- inline windows — the process owns an in-memory schedule seeded with
windows, and its
contract gains the schedule verb group (entries / set / add / clear):
class Matches extends Process.Tag<Matches>()("app/Matches").pipe(
Process.schedule([Process.window(kickoff, final)]),
) {}
- **an external
Schedule
** — the process is gated by a shared schedule resource and
gains no schedule verbs (they live on the resource, which can arm many processes at once):
class IngestScores extends Process.Tag<IngestScores>()("app/IngestScores").pipe(
Process.schedule(SeasonSchedule),
) {}
schedule(
source: HyperlinkTag<any, ScheduleHyperlinkSpec>source: import HyperlinkTagHyperlinkTag<any, type ScheduleHyperlinkSpec = {
entries: any
get: any
has: any
set: any
add: any
upsert: any
remove: any
removeMany: any
clear: any
}
The standalone
Schedule
resource's spec.
ScheduleHyperlinkSpec>,
): <function (type parameter) Self in <Self, S extends Spec>(tag: HyperlinkTag<Self, S>): HyperlinkTag<any, S>Self, function (type parameter) S in <Self, S extends Spec>(tag: HyperlinkTag<Self, S>): HyperlinkTag<any, S>S extends import SpecSpec>(tag: HyperlinkTag<Self, S>tag: import HyperlinkTagHyperlinkTag<function (type parameter) Self in <Self, S extends Spec>(tag: HyperlinkTag<Self, S>): HyperlinkTag<any, S>Self, function (type parameter) S in <Self, S extends Spec>(tag: HyperlinkTag<Self, S>): HyperlinkTag<any, S>S>) => import HyperlinkTagHyperlinkTag<any, function (type parameter) S in <Self, S extends Spec>(tag: HyperlinkTag<Self, S>): HyperlinkTag<any, S>S>;
export function function schedule(windows: ReadonlyArray<ScheduleWindow>): <Self, S extends Spec>(tag: HyperlinkTag<Self, S>) => HyperlinkTag<any, S & ScheduleGroupSpec> (+1 overload)Attach a schedule to a process (pipeable). Two forms, distinguished by argument:
- inline windows — the process owns an in-memory schedule seeded with
windows, and its
contract gains the schedule verb group (entries / set / add / clear):
class Matches extends Process.Tag<Matches>()("app/Matches").pipe(
Process.schedule([Process.window(kickoff, final)]),
) {}
- **an external
Schedule
** — the process is gated by a shared schedule resource and
gains no schedule verbs (they live on the resource, which can arm many processes at once):
class IngestScores extends Process.Tag<IngestScores>()("app/IngestScores").pipe(
Process.schedule(SeasonSchedule),
) {}
schedule(
windowsOrSource: | ReadonlyArray<ScheduleWindow>
| HyperlinkTag<any, any, any>
windowsOrSource: interface ReadonlyArray<T>ReadonlyArray<ScheduleWindow> | import HyperlinkTagHyperlinkTag<any, any, any>,
): (tag: HyperlinkTag<any, any, any>tag: import HyperlinkTagHyperlinkTag<any, any, any>) => import HyperlinkTagHyperlinkTag<any, any, any> {
// A type-guard (not bare `Array.isArray`) so the else-branch narrows to the tag: `Array.isArray`
// alone won't remove a `ReadonlyArray` from the union.
const const isWindows: (
x:
| ReadonlyArray<ScheduleWindow>
| HyperlinkTag<any, any, any>
) => x is ReadonlyArray<ScheduleWindow>
isWindows = (
x: | ReadonlyArray<ScheduleWindow>
| HyperlinkTag<any, any, any>
x: interface ReadonlyArray<T>ReadonlyArray<ScheduleWindow> | import HyperlinkTagHyperlinkTag<any, any, any>,
): x: | ReadonlyArray<ScheduleWindow>
| HyperlinkTag<any, any, any>
x is interface ReadonlyArray<T>ReadonlyArray<ScheduleWindow> => var Array: ArrayConstructorArray.ArrayConstructor.isArray(arg: any): arg is any[]isArray(x: | ReadonlyArray<ScheduleWindow>
| HyperlinkTag<any, any, any>
x);
if (const isWindows: (
x:
| ReadonlyArray<ScheduleWindow>
| HyperlinkTag<any, any, any>
) => x is ReadonlyArray<ScheduleWindow>
isWindows(windowsOrSource: | ReadonlyArray<ScheduleWindow>
| HyperlinkTag<any, any, any>
windowsOrSource)) {
const const mode: ScheduleModemode: type ScheduleMode =
| {
readonly _tag: "inline"
readonly windows: ReadonlyArray<ScheduleWindow>
}
| {
readonly _tag: "reference"
readonly source: HyperlinkTag<
unknown,
ScheduleHyperlinkSpec
>
}
How a process is scheduled — read by the runtime to build the right impl.
ScheduleMode = { _tag: "inline"_tag: "inline", windows: ReadonlyArray<ScheduleWindow>windows: windowsOrSource: | ReadonlyArray<ScheduleWindow>
| HyperlinkTag<any, any, any>
windowsOrSource };
return (tag: HyperlinkTag<any, any, any>tag) => const augmentTag: (
tag: HyperlinkTag<any, any, any>,
flatAddition: FlatSpec,
stamp: object
) => HyperlinkTag<any, any, any>
Graft path-keyed leaves onto a tag's flat spec and rebuild its RPC group in place, optionally
stamping combinator metadata. Reuses the tag's already-claimed groupId (no re-claim). Returns
the same (mutated) tag — so class X extends Tag()(...).pipe(combinator) {} extends it.
augmentTag(tag: HyperlinkTag<any, any, any>tag, const scheduleGroupFlat: FlatSpecFlatten the one-level schedule group to path keys (schedule.entries, …).
scheduleGroupFlat, { [const scheduleModeSym: typeof scheduleModeSymWhere a process tag's schedule mode (inline windows vs external reference) is stowed.
scheduleModeSym]: const mode: {
readonly _tag: "inline"
readonly windows: ReadonlyArray<ScheduleWindow>
}
mode });
}
const const mode: ScheduleModemode: type ScheduleMode =
| {
readonly _tag: "inline"
readonly windows: ReadonlyArray<ScheduleWindow>
}
| {
readonly _tag: "reference"
readonly source: HyperlinkTag<
unknown,
ScheduleHyperlinkSpec
>
}
How a process is scheduled — read by the runtime to build the right impl.
ScheduleMode = { _tag: "reference"_tag: "reference", source: HyperlinkTag<
unknown,
{
entries: any
get: any
has: any
set: any
add: any
upsert: any
remove: any
removeMany: any
clear: any
}
>
source: windowsOrSource: | ReadonlyArray<ScheduleWindow>
| HyperlinkTag<any, any, any>
windowsOrSource };
// reference form: shape is unchanged — just stamp the mode (identity, like `distributed`).
return (tag: HyperlinkTag<any, any, any>tag) => var Object: ObjectConstructorProvides functionality common to all JavaScript objects.
Object.ObjectConstructor.assign<HyperlinkTag<any, any, any>, {
[scheduleModeSym]: {
readonly _tag: "reference";
readonly source: HyperlinkTag<unknown, ScheduleHyperlinkSpec>;
};
}>(target: HyperlinkTag<any, any, any>, source: {
[scheduleModeSym]: {
readonly _tag: "reference";
readonly source: HyperlinkTag<unknown, ScheduleHyperlinkSpec>;
};
}): any (+3 overloads)
Copy the values of all of the enumerable own properties from one or more source objects to a
target object. Returns the target object.
assign(tag: HyperlinkTag<any, any, any>tag, { [const scheduleModeSym: typeof scheduleModeSymWhere a process tag's schedule mode (inline windows vs external reference) is stowed.
scheduleModeSym]: const mode: {
readonly _tag: "reference"
readonly source: HyperlinkTag<
unknown,
ScheduleHyperlinkSpec
>
}
mode });
}