@mark1russell7/service 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import { n as Clock } from "./clock-mVqhXD0b.js";
1
+ import { n as Clock } from "./clock-DpVgpY4h.js";
2
2
  import { ct as Operation, j as Poll } from "./logger-BY1RFLzq.js";
3
- import { C as MANIFESTATIONS, D as firstDetector, E as Situation, O as unwatched, S as Detector, T as Meeting, _ as Sent, a as ClientKnobs, c as ClientSpec, d as Factory, g as SendOptions, h as STARTING_POLL, i as ClientJoin, l as ClientStep, n as CheckOptions, o as ClientOptions, r as Client, s as ClientSocket, t as Attempt, u as DialFn, w as Manifestation } from "./core-BkdE4pz1.js";
4
- import { t as Judge } from "./dial-CyVazFF-.js";
3
+ import { C as MANIFESTATIONS, D as firstDetector, E as Situation, O as unwatched, S as Detector, T as Meeting, _ as Sent, a as ClientKnobs, c as ClientSpec, d as Factory, g as SendOptions, h as STARTING_POLL, i as ClientJoin, l as ClientStep, n as CheckOptions, o as ClientOptions, r as Client, s as ClientSocket, t as Attempt, u as DialFn, w as Manifestation } from "./core-Cuh3oSfr.js";
4
+ import { t as Judge } from "./dial-ZJNa6s9i.js";
5
5
  import { Extent, Quantity } from "@mark1russell7/quantity";
6
6
  import { Machine } from "@mark1russell7/algebra";
7
7
  //#region src/http-client/connection.d.ts
package/build/http.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { n as Clock } from "./clock-mVqhXD0b.js";
1
+ import { n as Clock } from "./clock-DpVgpY4h.js";
2
2
  import { f as Refused } from "./policy-CwYR95Sz.js";
3
- import { S as Health, T as ProbeKind, b as RequestWork, d as TransportImpl, h as RequestEnd, n as HealthServer, r as Lifecycle, y as RequestStream } from "./lifecycle-BuFfbY3s.js";
3
+ import { S as Health, T as ProbeKind, b as RequestWork, d as TransportImpl, h as RequestEnd, n as HealthServer, r as Lifecycle, y as RequestStream } from "./lifecycle-C8ffyrQ9.js";
4
4
  import { Extent, Quantity } from "@mark1russell7/quantity";
5
5
  import { ListenOptions } from "node:net";
6
6
  import { IncomingMessage, Server, ServerEventMap, ServerResponse } from "node:http";
package/build/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  import { a as backoffDelay, i as backoffBand, n as DelayBand, o as backoffProblems, r as Jitter, t as Backoff } from "./backoff-B-jGWVDm.js";
2
- import { a as realClock, i as platformClock, n as Clock, r as PlatformClockOptions, t as Cancel } from "./clock-mVqhXD0b.js";
2
+ import { a as realClock, i as platformClock, n as Clock, r as PlatformClockOptions, t as Cancel } from "./clock-DpVgpY4h.js";
3
3
  import { C as limitRule, D as retryAfterSeconds, E as overCapacity, O as unitsOf, S as idleSpan, T as longestRetryAfter, _ as WaitCause, a as LimitPolicy, b as decide, c as LimiterEviction, d as RefusalCause, f as Refused, g as TokenBucket, h as TakeStep, i as KeyState, l as LimiterSpec, m as StoreFailure, n as CapacityRefused, o as LimitRule, p as SlidingWindow, r as Decision, s as Limiter, t as Allowed, u as LimiterStoreSpec, v as WaitRefused, w as limiterProblems, x as freeAt, y as capacityOf } from "./policy-CwYR95Sz.js";
4
4
  import { $ as UncaughtOrigin, A as FailsBy, B as RoutePattern, C as MessageTrigger, D as ServiceDescription, E as RepeatSignal, F as asWindow, G as ExitTrigger, H as EXIT_SIGNALS, I as failSpan, J as PROCESS_TRIGGERS, K as HostStream, L as heartbeatDetection, M as Span, N as Timing, O as Step, P as asDebounce, Q as UNCAUGHT_ORIGINS, R as recoverSpan, S as Gate, T as ProgressMarks, U as EmbeddedProcess, V as RouteRequest, W as ExitSignal, X as ProcessPort, Y as ProcessHost, Z as ProcessTrigger, _ as CooperativeFloor, a as LogFields, at as nodeProcess, b as ExitCodes, c as Logger, ct as Operation, d as logEvents, et as embeddedProcess, f as LifecycleEvent, g as Controller, h as Check, i as LogEntry, it as matchesMessage, j as Poll, k as Transport, l as atLeast, lt as mayReissue, m as Recorder, n as ConsoleTarget, nt as isExitSignal, o as LogFormat, ot as processPortOf, p as MachineName, q as MessageShape, r as LOG_LEVELS, rt as isMessageShape, s as LogLevel, st as Idempotency, t as ConsoleLoggerOptions, tt as isExitCode, u as consoleLogger, v as Coupling, w as Phase, x as FORMAT, y as Dependency, z as OperationOf } from "./logger-BY1RFLzq.js";
5
- import { A as DurationHistogram, C as HealthVerdict, D as CheckFn, E as StartOptions, F as Outcome, I as Result, M as Episode, N as HealthMetrics, O as CheckMetrics, P as redact, S as Health, T as ProbeKind, _ as RequestFn, a as PhaseContext, b as RequestWork, c as STAGES, d as TransportImpl, f as UncaughtOptions, g as RequestEvent, h as RequestEnd, i as LifecycleState, j as EPISODES_KEPT, k as DURATION_FRACTIONS, l as ShutdownOptions, m as stageRank, n as HealthServer, o as PhaseWork, p as cooperativeAbortAt, r as Lifecycle, s as RunOptions, t as DependencyHandle, u as Stage, v as RequestOptions, w as ProbeAnswer, x as CheckVerdict, y as RequestStream } from "./lifecycle-BuFfbY3s.js";
6
- import { a as WatchdogSpec, c as Profile, d as kubernetes, f as localDev, i as Watchdog, l as daemon, n as ServiceBuilder, o as watchdog, r as service, s as PodTiming, t as ControllerBuilder, u as ephemeral } from "./builder-DPsy9XVN.js";
5
+ import { A as DurationHistogram, C as HealthVerdict, D as CheckFn, E as StartOptions, F as Outcome, I as Result, M as Episode, N as HealthMetrics, O as CheckMetrics, P as redact, S as Health, T as ProbeKind, _ as RequestFn, a as PhaseContext, b as RequestWork, c as STAGES, d as TransportImpl, f as UncaughtOptions, g as RequestEvent, h as RequestEnd, i as LifecycleState, j as EPISODES_KEPT, k as DURATION_FRACTIONS, l as ShutdownOptions, m as stageRank, n as HealthServer, o as PhaseWork, p as cooperativeAbortAt, r as Lifecycle, s as RunOptions, t as DependencyHandle, u as Stage, v as RequestOptions, w as ProbeAnswer, x as CheckVerdict, y as RequestStream } from "./lifecycle-C8ffyrQ9.js";
6
+ import { a as WatchdogSpec, c as Profile, d as kubernetes, f as localDev, i as Watchdog, l as daemon, n as ServiceBuilder, o as watchdog, r as service, s as PodTiming, t as ControllerBuilder, u as ephemeral } from "./builder-BWfcgx__.js";
7
7
  import { Heartbeat, HeartbeatOptions, detectionTime, heartbeat } from "./heartbeat.js";
8
8
  import { C as symbolsOf, S as inequalities, _ as TimerMarks, a as O16, b as compression, c as Change, d as Evaluated, f as Inequality, g as TimerMark, h as Term, i as O10, l as Compressed, m as Side, n as O04, o as Binding, p as Rule, r as O09, s as Bound, t as DRAIN_RULES, u as Compression, v as Verdict, w as verdictOf, x as evaluate, y as compress } from "./rules-BBRopO1e.js";
9
- import { a as TakeRequest, i as MemoryStore, n as LimiterStore, o as keyedLimiter, r as LocalLimiter, s as memoryStore, t as KeyedLimiter } from "./store-KWQVA3mp.js";
10
- import { a as limiterStateOf, i as limiterMachine, n as SLIDING_WINDOW_MACHINE, r as TOKEN_BUCKET_MACHINE, t as LimiterState } from "./limiter-CkJ_QVFj.js";
11
- import { a as JobSource, c as QueueKnobs, d as queueDrain, f as redeliverOnce, i as JobSettle, l as RedeliveryPolicy, n as JobContext, o as QueueDrain, p as UnitRequest, r as JobFailure, s as QueueDrainOptions, t as JobAction, u as RequeueCause } from "./queue-CDYBywuU.js";
9
+ import { a as TakeRequest, i as MemoryStore, n as LimiterStore, o as keyedLimiter, r as LocalLimiter, s as memoryStore, t as KeyedLimiter } from "./store-1CsNoJ8O.js";
10
+ import { a as limiterStateOf, i as limiterMachine, n as SLIDING_WINDOW_MACHINE, r as TOKEN_BUCKET_MACHINE, t as LimiterState } from "./limiter-D1aluA0V.js";
11
+ import { a as JobSource, c as QueueKnobs, d as queueDrain, f as redeliverOnce, i as JobSettle, l as RedeliveryPolicy, n as JobContext, o as QueueDrain, p as UnitRequest, r as JobFailure, s as QueueDrainOptions, t as JobAction, u as RequeueCause } from "./queue-rfmKMwju.js";
12
12
  import { Extent, Quantity } from "@mark1russell7/quantity";
13
13
  import { replay } from "@mark1russell7/algebra/replay";
14
14
  import { Machine } from "@mark1russell7/algebra";
@@ -1,4 +1,4 @@
1
- import { n as Clock } from "./clock-mVqhXD0b.js";
1
+ import { n as Clock } from "./clock-DpVgpY4h.js";
2
2
  import { $ as UncaughtOrigin, S as Gate, X as ProcessPort, _ as CooperativeFloor, c as Logger, h as Check, m as Recorder } from "./logger-BY1RFLzq.js";
3
3
  import { Extent } from "@mark1russell7/quantity";
4
4
  //#region src/latch.d.ts
@@ -384,4 +384,4 @@ interface Lifecycle {
384
384
  }
385
385
  //#endregion
386
386
  export { DurationHistogram as A, HealthVerdict as C, CheckFn as D, StartOptions as E, Outcome as F, Result as I, Trace as L, Episode as M, HealthMetrics as N, CheckMetrics as O, redact as P, Health as S, ProbeKind as T, RequestFn as _, PhaseContext as a, RequestWork as b, STAGES as c, TransportImpl as d, UncaughtOptions as f, RequestEvent as g, RequestEnd as h, LifecycleState as i, EPISODES_KEPT as j, DURATION_FRACTIONS as k, ShutdownOptions as l, stageRank as m, HealthServer as n, PhaseWork as o, cooperativeAbortAt as p, Lifecycle as r, RunOptions as s, DependencyHandle as t, Stage as u, RequestOptions as v, ProbeAnswer as w, CheckVerdict as x, RequestStream as y };
387
- //# sourceMappingURL=lifecycle-BuFfbY3s.d.ts.map
387
+ //# sourceMappingURL=lifecycle-C8ffyrQ9.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { a as LimitPolicy, i as KeyState, o as LimitRule } from "./policy-CwYR95Sz.js";
2
- import "./store-KWQVA3mp.js";
2
+ import "./store-1CsNoJ8O.js";
3
3
  import { Machine } from "@mark1russell7/algebra";
4
4
  //#region src/limiter/machine.d.ts
5
5
  /**
@@ -42,4 +42,4 @@ declare const limiterMachine: (policy: LimitPolicy) => Machine;
42
42
  declare const limiterStateOf: (rule: LimitRule, state: KeyState | undefined, now: number) => LimiterState;
43
43
  //#endregion
44
44
  export { limiterStateOf as a, limiterMachine as i, SLIDING_WINDOW_MACHINE as n, TOKEN_BUCKET_MACHINE as r, LimiterState as t };
45
- //# sourceMappingURL=limiter-CkJ_QVFj.d.ts.map
45
+ //# sourceMappingURL=limiter-D1aluA0V.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import { C as limitRule, D as retryAfterSeconds, E as overCapacity, O as unitsOf, S as idleSpan, T as longestRetryAfter, _ as WaitCause, a as LimitPolicy, b as decide, c as LimiterEviction, d as RefusalCause, f as Refused, g as TokenBucket, h as TakeStep, i as KeyState, l as LimiterSpec, m as StoreFailure, n as CapacityRefused, o as LimitRule, p as SlidingWindow, r as Decision, s as Limiter, t as Allowed, u as LimiterStoreSpec, v as WaitRefused, w as limiterProblems, x as freeAt, y as capacityOf } from "./policy-CwYR95Sz.js";
2
- import { a as TakeRequest, i as MemoryStore, n as LimiterStore, o as keyedLimiter, r as LocalLimiter, s as memoryStore, t as KeyedLimiter } from "./store-KWQVA3mp.js";
3
- import { a as limiterStateOf, i as limiterMachine, n as SLIDING_WINDOW_MACHINE, r as TOKEN_BUCKET_MACHINE, t as LimiterState } from "./limiter-CkJ_QVFj.js";
2
+ import { a as TakeRequest, i as MemoryStore, n as LimiterStore, o as keyedLimiter, r as LocalLimiter, s as memoryStore, t as KeyedLimiter } from "./store-1CsNoJ8O.js";
3
+ import { a as limiterStateOf, i as limiterMachine, n as SLIDING_WINDOW_MACHINE, r as TOKEN_BUCKET_MACHINE, t as LimiterState } from "./limiter-D1aluA0V.js";
4
4
  export { type Allowed, type CapacityRefused, type Decision, type KeyState, type KeyedLimiter, type LimitPolicy, type LimitRule, type Limiter, type LimiterEviction, type LimiterSpec, type LimiterState, type LimiterStore, type LimiterStoreSpec, type LocalLimiter, type MemoryStore, type RefusalCause, type Refused, SLIDING_WINDOW_MACHINE, type SlidingWindow, type StoreFailure, TOKEN_BUCKET_MACHINE, type TakeRequest, type TakeStep, type TokenBucket, type WaitCause, type WaitRefused, capacityOf, decide, freeAt, idleSpan, keyedLimiter, limitRule, limiterMachine, limiterProblems, limiterStateOf, longestRetryAfter, memoryStore, overCapacity, retryAfterSeconds, unitsOf };
@@ -1,6 +1,6 @@
1
1
  import { ct as Operation, j as Poll } from "./logger-BY1RFLzq.js";
2
- import { C as MANIFESTATIONS, D as firstDetector, E as Situation, O as unwatched, S as Detector, T as Meeting, _ as Sent, a as ClientKnobs, c as ClientSpec, d as Factory, g as SendOptions, h as STARTING_POLL, i as ClientJoin, l as ClientStep, n as CheckOptions, o as ClientOptions, r as Client, s as ClientSocket, t as Attempt, u as DialFn, w as Manifestation } from "./core-BkdE4pz1.js";
3
- import { t as Judge } from "./dial-CyVazFF-.js";
2
+ import { C as MANIFESTATIONS, D as firstDetector, E as Situation, O as unwatched, S as Detector, T as Meeting, _ as Sent, a as ClientKnobs, c as ClientSpec, d as Factory, g as SendOptions, h as STARTING_POLL, i as ClientJoin, l as ClientStep, n as CheckOptions, o as ClientOptions, r as Client, s as ClientSocket, t as Attempt, u as DialFn, w as Manifestation } from "./core-Cuh3oSfr.js";
3
+ import { t as Judge } from "./dial-ZJNa6s9i.js";
4
4
  import { Extent, Quantity } from "@mark1russell7/quantity";
5
5
  import { Machine } from "@mark1russell7/algebra";
6
6
  //#region src/mongodb/connection.d.ts
package/build/pg.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ct as Operation, j as Poll } from "./logger-BY1RFLzq.js";
2
- import { C as MANIFESTATIONS, D as firstDetector, E as Situation, O as unwatched, S as Detector, T as Meeting, _ as Sent, a as ClientKnobs, c as ClientSpec, d as Factory, g as SendOptions, h as STARTING_POLL, i as ClientJoin, l as ClientStep, n as CheckOptions, o as ClientOptions, r as Client, s as ClientSocket, t as Attempt, u as DialFn, w as Manifestation } from "./core-BkdE4pz1.js";
2
+ import { C as MANIFESTATIONS, D as firstDetector, E as Situation, O as unwatched, S as Detector, T as Meeting, _ as Sent, a as ClientKnobs, c as ClientSpec, d as Factory, g as SendOptions, h as STARTING_POLL, i as ClientJoin, l as ClientStep, n as CheckOptions, o as ClientOptions, r as Client, s as ClientSocket, t as Attempt, u as DialFn, w as Manifestation } from "./core-Cuh3oSfr.js";
3
3
  import { Extent, Quantity } from "@mark1russell7/quantity";
4
4
  import { Machine } from "@mark1russell7/algebra";
5
5
  //#region src/pg/connection.d.ts
@@ -1,4 +1,4 @@
1
- import { n as Clock } from "./clock-mVqhXD0b.js";
1
+ import { n as Clock } from "./clock-DpVgpY4h.js";
2
2
  import { c as Logger } from "./logger-BY1RFLzq.js";
3
3
  //#region src/host/ports.d.ts
4
4
  /** These options go with one command: the folder that it runs in, and the most time that it can take. */
@@ -122,4 +122,4 @@ interface HostPorts {
122
122
  declare const joinPath: (platform: string, ...parts: readonly string[]) => string;
123
123
  //#endregion
124
124
  export { FilePort as a, ProcessMark as c, StopSignal as d, joinPath as f, CommandResult as i, ProcessesPort as l, CommandOptions as n, HostPorts as o, CommandPort as r, NetPort as s, ChildHandle as t, SpawnRequest as u };
125
- //# sourceMappingURL=ports-D1U2EHmR.d.ts.map
125
+ //# sourceMappingURL=ports-D-Anj51B.d.ts.map
@@ -1,6 +1,6 @@
1
- import { n as Clock } from "./clock-mVqhXD0b.js";
1
+ import { n as Clock } from "./clock-DpVgpY4h.js";
2
2
  import { D as ServiceDescription } from "./logger-BY1RFLzq.js";
3
- import { d as TransportImpl, r as Lifecycle } from "./lifecycle-BuFfbY3s.js";
3
+ import { d as TransportImpl, r as Lifecycle } from "./lifecycle-C8ffyrQ9.js";
4
4
  import { Extent, Quantity } from "@mark1russell7/quantity";
5
5
  //#region src/units.d.ts
6
6
  /**
@@ -148,4 +148,4 @@ declare const redeliverOnce: <J>(then: JobAction | RedeliveryPolicy<J>, poison?:
148
148
  declare const queueDrain: <J>(knobs: QueueKnobs, options: QueueDrainOptions<J>) => QueueDrain;
149
149
  //#endregion
150
150
  export { JobSource as a, QueueKnobs as c, queueDrain as d, redeliverOnce as f, JobSettle as i, RedeliveryPolicy as l, JobContext as n, QueueDrain as o, UnitRequest as p, JobFailure as r, QueueDrainOptions as s, JobAction as t, RequeueCause as u };
151
- //# sourceMappingURL=queue-CDYBywuU.d.ts.map
151
+ //# sourceMappingURL=queue-rfmKMwju.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { j as Poll } from "./logger-BY1RFLzq.js";
2
- import { C as MANIFESTATIONS, D as firstDetector, E as Situation, O as unwatched, S as Detector, T as Meeting, _ as Sent, a as ClientKnobs, b as retryProblems, c as ClientSpec, d as Factory, f as ReadyWait, g as SendOptions, h as STARTING_POLL, i as ClientJoin, l as ClientStep, n as CheckOptions, o as ClientOptions, p as RetryKnobs, r as Client, s as ClientSocket, t as Attempt, u as DialFn, v as readyWait, w as Manifestation, y as retryBackoff } from "./core-BkdE4pz1.js";
3
- import { t as Judge } from "./dial-CyVazFF-.js";
4
- import { i as JobSettle } from "./queue-CDYBywuU.js";
2
+ import { C as MANIFESTATIONS, D as firstDetector, E as Situation, O as unwatched, S as Detector, T as Meeting, _ as Sent, a as ClientKnobs, b as retryProblems, c as ClientSpec, d as Factory, f as ReadyWait, g as SendOptions, h as STARTING_POLL, i as ClientJoin, l as ClientStep, n as CheckOptions, o as ClientOptions, p as RetryKnobs, r as Client, s as ClientSocket, t as Attempt, u as DialFn, v as readyWait, w as Manifestation, y as retryBackoff } from "./core-Cuh3oSfr.js";
3
+ import { t as Judge } from "./dial-ZJNa6s9i.js";
4
+ import { i as JobSettle } from "./queue-rfmKMwju.js";
5
5
  import { Extent, Quantity } from "@mark1russell7/quantity";
6
6
  import { Machine } from "@mark1russell7/algebra";
7
7
  //#region src/rabbitmq/connection.d.ts
package/build/redis.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { n as Clock } from "./clock-mVqhXD0b.js";
1
+ import { n as Clock } from "./clock-DpVgpY4h.js";
2
2
  import { L as heartbeatDetection, ct as Operation } from "./logger-BY1RFLzq.js";
3
- import { C as MANIFESTATIONS, D as firstDetector, E as Situation, O as unwatched, S as Detector, T as Meeting, _ as Sent, a as ClientKnobs, c as ClientSpec, d as Factory, g as SendOptions, i as ClientJoin, l as ClientStep, n as CheckOptions, o as ClientOptions, p as RetryKnobs, r as Client, s as ClientSocket, t as Attempt, u as DialFn, w as Manifestation, y as retryBackoff } from "./core-BkdE4pz1.js";
4
- import { n as LimiterStore } from "./store-KWQVA3mp.js";
3
+ import { C as MANIFESTATIONS, D as firstDetector, E as Situation, O as unwatched, S as Detector, T as Meeting, _ as Sent, a as ClientKnobs, c as ClientSpec, d as Factory, g as SendOptions, i as ClientJoin, l as ClientStep, n as CheckOptions, o as ClientOptions, p as RetryKnobs, r as Client, s as ClientSocket, t as Attempt, u as DialFn, w as Manifestation, y as retryBackoff } from "./core-Cuh3oSfr.js";
4
+ import { n as LimiterStore } from "./store-1CsNoJ8O.js";
5
5
  import { Extent, Quantity } from "@mark1russell7/quantity";
6
6
  import { Machine } from "@mark1russell7/algebra";
7
7
  //#region src/redis/connection.d.ts
@@ -1,4 +1,4 @@
1
- import { n as Clock } from "./clock-mVqhXD0b.js";
1
+ import { n as Clock } from "./clock-DpVgpY4h.js";
2
2
  import { l as LimiterSpec, o as LimitRule, r as Decision } from "./policy-CwYR95Sz.js";
3
3
  //#region src/limiter/store.d.ts
4
4
  /** A take request is one take of one key, with the rule and the cap of its limiter in numbers. */
@@ -91,4 +91,4 @@ declare function keyedLimiter(name: string, spec: LimiterSpec, store: MemoryStor
91
91
  declare function keyedLimiter(name: string, spec: LimiterSpec, store: LimiterStore): KeyedLimiter;
92
92
  //#endregion
93
93
  export { TakeRequest as a, MemoryStore as i, LimiterStore as n, keyedLimiter as o, LocalLimiter as r, memoryStore as s, KeyedLimiter as t };
94
- //# sourceMappingURL=store-KWQVA3mp.d.ts.map
94
+ //# sourceMappingURL=store-1CsNoJ8O.d.ts.map
@@ -1,23 +1,10 @@
1
- import { n as Clock } from "./clock-mVqhXD0b.js";
1
+ import { n as Clock } from "./clock-DpVgpY4h.js";
2
2
  import { $ as UncaughtOrigin, G as ExitTrigger, W as ExitSignal, X as ProcessPort, c as Logger, i as LogEntry, s as LogLevel } from "./logger-BY1RFLzq.js";
3
- import { D as CheckFn, F as Outcome, _ as RequestFn, d as TransportImpl, h as RequestEnd, r as Lifecycle } from "./lifecycle-BuFfbY3s.js";
4
- import { n as ServiceBuilder } from "./builder-DPsy9XVN.js";
5
- import { c as ProcessMark, d as StopSignal, i as CommandResult, n as CommandOptions, o as HostPorts, t as ChildHandle, u as SpawnRequest } from "./ports-D1U2EHmR.js";
3
+ import { D as CheckFn, F as Outcome, _ as RequestFn, d as TransportImpl, h as RequestEnd, r as Lifecycle } from "./lifecycle-C8ffyrQ9.js";
4
+ import { n as ServiceBuilder } from "./builder-BWfcgx__.js";
5
+ import { c as ProcessMark, d as StopSignal, i as CommandResult, n as CommandOptions, o as HostPorts, t as ChildHandle, u as SpawnRequest } from "./ports-D-Anj51B.js";
6
+ import { FakeClock, fakeClock } from "@mark1russell7/algebra/clock";
6
7
  //#region src/fakes.d.ts
7
- /** A fake clock moves only when a test tells it to. */
8
- interface FakeClock extends Clock {
9
- /** This method moves the clock forward by `ms`, and it starts each timer that comes due, in sequence. */
10
- advance(ms: number): Promise<void>;
11
- /**
12
- * This method moves the clock forward by `ms` and starts no timer, as a blocked event loop does.
13
- * The next `advance` then starts each timer that came due during the block, late.
14
- */
15
- block(ms: number): void;
16
- /** This count is the number of timers that are not stopped and not called. */
17
- readonly pending: number;
18
- }
19
- /** This function makes a fake clock. Its time starts at `start` milliseconds. */
20
- export declare const fakeClock: (start?: number) => FakeClock;
21
8
  /** A fake process receives triggers from a test, and keeps each exit code in place of an exit. */
22
9
  interface FakeProcess extends ProcessPort {
23
10
  /** This method sends a signal to each handler of it. */
@@ -338,5 +325,5 @@ export interface QuietServer {
338
325
  */
339
326
  export declare const quietServer: () => Promise<QuietServer>;
340
327
  //#endregion
341
- export type { CallerView, ConformanceOptions, ConformanceRecord, ContractCase, ContractOptions, FakeChild, FakeClock, FakeHost, FakeHostOptions, FakeProcess, FakeProcessOptions, HeldWork, RecordedCommand, RecordedSignal, SeenEnd, StreamCall, SubjectFactory, TransportSubject };
328
+ export { type CallerView, type ConformanceOptions, type ConformanceRecord, type ContractCase, type ContractOptions, type FakeChild, type FakeClock, type FakeHost, type FakeHostOptions, type FakeProcess, type FakeProcessOptions, type HeldWork, type RecordedCommand, type RecordedSignal, type SeenEnd, type StreamCall, type SubjectFactory, type TransportSubject, fakeClock };
342
329
  //# sourceMappingURL=testing.d.ts.map
package/build/testing.js CHANGED
@@ -3,61 +3,11 @@ import { a as recoverSpan, r as failSpan } from "./timing-DGRi3XCI.js";
3
3
  import { s as ownStream } from "./knobs-D2ClI68I.js";
4
4
  import { t as tracker } from "./requests-BIq9Tr4P.js";
5
5
  import { valueIn } from "@mark1russell7/quantity";
6
+ import { fakeClock } from "@mark1russell7/algebra/clock";
6
7
  import { createServer } from "node:net";
7
8
  import { mulberry32 } from "@mark1russell7/rigor-generators";
8
9
  import "node:events";
9
10
  //#region src/fakes.ts
10
- /** This function lets the promises that are ready continue, before the clock moves again. */
11
- const settle = async () => {
12
- for (let turn = 0; turn < 64; turn += 1) await Promise.resolve();
13
- };
14
- /** This function makes a fake clock. Its time starts at `start` milliseconds. */
15
- const fakeClock = (start = 0) => {
16
- let now = start;
17
- let sequence = 0;
18
- const timers = [];
19
- const due = (end) => {
20
- let best;
21
- for (const timer of timers) if (timer.live && timer.at <= end && (best === void 0 || timer.at < best.at || timer.at === best.at && timer.order < best.order)) best = timer;
22
- return best;
23
- };
24
- return {
25
- now: () => now,
26
- after(ms, run) {
27
- const timer = {
28
- at: now + Math.max(0, ms),
29
- order: sequence++,
30
- run,
31
- live: true
32
- };
33
- timers.push(timer);
34
- return () => {
35
- timer.live = false;
36
- };
37
- },
38
- async advance(ms) {
39
- const end = now + Math.max(0, ms);
40
- await settle();
41
- for (;;) {
42
- const timer = due(end);
43
- if (timer === void 0) break;
44
- timer.live = false;
45
- now = Math.max(now, timer.at);
46
- timer.run();
47
- await settle();
48
- }
49
- now = Math.max(now, end);
50
- for (let at = timers.length - 1; at >= 0; at -= 1) if (!timers[at].live) timers.splice(at, 1);
51
- await settle();
52
- },
53
- block(ms) {
54
- now += Math.max(0, ms);
55
- },
56
- get pending() {
57
- return timers.filter((timer) => timer.live).length;
58
- }
59
- };
60
- };
61
11
  /** This function makes a fake process. */
62
12
  const fakeProcess = (options = {}) => {
63
13
  const handlers = /* @__PURE__ */ new Map();