@intelligems/sst 2.49.6-ig.9 → 2.49.8-ig.2
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.
- package/cli/commands/dev.js +10 -6
- package/constructs/AstroSite.d.ts +1 -1
- package/constructs/EdgeFunction.d.ts +1 -1
- package/constructs/EdgeFunction.js +8 -6
- package/constructs/Function.d.ts +3 -2
- package/constructs/Function.js +2 -1
- package/constructs/Job.d.ts +2 -2
- package/constructs/Job.js +4 -2
- package/constructs/NextjsSite.d.ts +1 -1
- package/constructs/NextjsSite.js +2 -2
- package/constructs/RemixSite.d.ts +1 -1
- package/constructs/SolidStartSite.d.ts +1 -1
- package/constructs/SsrFunction.d.ts +2 -2
- package/constructs/SsrFunction.js +7 -5
- package/constructs/SsrSite.d.ts +2 -2
- package/constructs/SsrSite.js +1 -1
- package/constructs/Stack.d.ts +1 -1
- package/constructs/Stack.js +1 -1
- package/constructs/SvelteKitSite.d.ts +1 -1
- package/constructs/deprecated/NextjsSite.d.ts +3 -3
- package/constructs/deprecated/NextjsSite.js +4 -1
- package/constructs/deprecated/cross-region-helper.js +3 -3
- package/package.json +3 -3
- package/runtime/handlers/node.js +24 -2
- package/runtime/handlers.d.ts +4 -0
- package/runtime/memory-logging.d.ts +26 -0
- package/runtime/memory-logging.js +112 -0
- package/runtime/mono-build-config.d.ts +6 -3
- package/runtime/mono-build-config.js +34 -10
- package/runtime/server.js +35 -44
- package/runtime/stdout-attribution.d.ts +18 -0
- package/runtime/stdout-attribution.js +43 -0
- package/runtime/worker-config.d.ts +19 -0
- package/runtime/worker-config.js +26 -0
- package/runtime/worker-pool-logging.d.ts +2 -2
- package/runtime/worker-pool-logging.js +5 -5
- package/runtime/worker-pool.d.ts +77 -0
- package/runtime/worker-pool.js +162 -0
- package/runtime/workers.d.ts +33 -11
- package/runtime/workers.js +405 -513
- package/support/nodejs-runtime/index.mjs +214 -100
- package/watcher.js +2 -0
- package/README.md +0 -43
- package/package.json.bak +0 -156
package/runtime/workers.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EventPayload } from "../bus.js";
|
|
1
2
|
declare module "../bus.js" {
|
|
2
3
|
interface Events {
|
|
3
4
|
"worker.started": {
|
|
@@ -11,6 +12,8 @@ declare module "../bus.js" {
|
|
|
11
12
|
"worker.exited": {
|
|
12
13
|
workerID: string;
|
|
13
14
|
functionID: string;
|
|
15
|
+
/** Set for pooled workers: the id the runtime server keys on. */
|
|
16
|
+
pooledWorkerID?: string;
|
|
14
17
|
};
|
|
15
18
|
"worker.stdout": {
|
|
16
19
|
workerID: string;
|
|
@@ -39,27 +42,45 @@ declare module "../bus.js" {
|
|
|
39
42
|
};
|
|
40
43
|
}
|
|
41
44
|
}
|
|
45
|
+
interface Worker {
|
|
46
|
+
workerID: string;
|
|
47
|
+
functionID: string;
|
|
48
|
+
}
|
|
42
49
|
export declare const useRuntimeWorkers: () => Promise<{
|
|
43
|
-
fromID(workerID: string):
|
|
44
|
-
workerID: string;
|
|
45
|
-
functionID: string;
|
|
46
|
-
};
|
|
50
|
+
fromID(workerID: string): Worker;
|
|
47
51
|
getCurrentRequestID(workerID: string): string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Who a response belongs to. Pooled workers may hold several requests,
|
|
54
|
+
* so the request id decides; non-pooled workers are their own AWS worker.
|
|
55
|
+
*/
|
|
56
|
+
resolveRequest(workerID: string, requestID?: string): {
|
|
57
|
+
awsWorkerID: string;
|
|
58
|
+
functionID: string;
|
|
59
|
+
} | undefined;
|
|
48
60
|
stdout(workerID: string, message: string): void;
|
|
49
61
|
exited(workerID: string): void;
|
|
50
|
-
onResponse(pooledWorkerID: string): void;
|
|
51
|
-
getAwsWorkerID(pooledWorkerID: string): string | undefined;
|
|
62
|
+
onResponse(pooledWorkerID: string, requestID?: string): void;
|
|
52
63
|
isPooled(workerID: string): boolean;
|
|
53
|
-
|
|
64
|
+
stats: () => {
|
|
65
|
+
workers: number;
|
|
66
|
+
inFlight: number;
|
|
67
|
+
queued: number;
|
|
68
|
+
};
|
|
69
|
+
subscribe: <Type extends "worker.started" | "worker.stopped" | "worker.exited" | "worker.stdout" | "worker.reused">(type: Type, cb: (payload: EventPayload<Type>) => void) => {
|
|
54
70
|
type: keyof import("../bus.js").Events;
|
|
55
71
|
cb: (payload: any) => void;
|
|
56
72
|
};
|
|
57
73
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
74
|
+
* Warm the pool by invoking a Node function with warm pings.
|
|
75
|
+
*
|
|
76
|
+
* Each ping is marked as a fan-out *child* (`__WARMER_INVOCATION__ > 1`)
|
|
77
|
+
* so the app's lambda-warmer preloads its handlers and returns instead of
|
|
78
|
+
* fanning out to `concurrency` more Lambdas, which is what turned the old
|
|
79
|
+
* 30 pings into ~900 worker creations. The count is capped at the pool
|
|
80
|
+
* size, and pings go through the normal pool path, so warmup can never
|
|
81
|
+
* hold more isolates than steady state.
|
|
61
82
|
*/
|
|
62
|
-
triggerWarmup(count
|
|
83
|
+
triggerWarmup(count: number): Promise<{
|
|
63
84
|
warmed: number;
|
|
64
85
|
elapsed?: undefined;
|
|
65
86
|
} | {
|
|
@@ -67,3 +88,4 @@ export declare const useRuntimeWorkers: () => Promise<{
|
|
|
67
88
|
elapsed: number;
|
|
68
89
|
}>;
|
|
69
90
|
}>;
|
|
91
|
+
export {};
|