@rivetkit/rivetkit-napi 2.3.0-rc.5 → 2.3.0-rc.7
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/index.d.ts +11 -0
- package/index.js +10 -1
- package/package.json +9 -9
package/index.d.ts
CHANGED
|
@@ -183,6 +183,15 @@ export interface JsServerlessStreamError {
|
|
|
183
183
|
code: string
|
|
184
184
|
message: string
|
|
185
185
|
}
|
|
186
|
+
export declare function jsSetEventloopLagQuantile(quantile: string, seconds: number): void
|
|
187
|
+
export declare function jsSetEventloopUtilization(value: number): void
|
|
188
|
+
export declare function jsSetEventloopHeartbeatTsMs(epochMs: number): void
|
|
189
|
+
export declare function jsAddProcessCpuSeconds(mode: string, seconds: number): void
|
|
190
|
+
export declare function jsSetProcessResidentMemoryBytes(bytes: number): void
|
|
191
|
+
export declare function jsSetHeapBytes(state: string, bytes: number): void
|
|
192
|
+
export declare function jsObserveGcDuration(kind: string, seconds: number): void
|
|
193
|
+
export declare function jsSetActiveHandles(count: number): void
|
|
194
|
+
export declare function jsSetActiveRequests(count: number): void
|
|
186
195
|
/** Options for KV list operations. */
|
|
187
196
|
export interface JsKvListOptions {
|
|
188
197
|
reverse?: boolean
|
|
@@ -240,6 +249,7 @@ export declare class ActorContext {
|
|
|
240
249
|
disconnectConns(predicate: (...args: any[]) => any): Promise<void>
|
|
241
250
|
broadcast(name: string, args: Buffer): void
|
|
242
251
|
waitUntil(promise: Promise<any>): void
|
|
252
|
+
waitForTrackedShutdownWork(): Promise<boolean>
|
|
243
253
|
registerTask(promise: Promise<any>): void
|
|
244
254
|
runtimeState(): object
|
|
245
255
|
clearRuntimeState(): void
|
|
@@ -314,6 +324,7 @@ export declare class CoreRegistry {
|
|
|
314
324
|
* separately to avoid re-entrancy.
|
|
315
325
|
*/
|
|
316
326
|
shutdown(): Promise<void>
|
|
327
|
+
actorStopThresholdMs(): Promise<number | null>
|
|
317
328
|
diagnostics(): Promise<JsRegistryDiagnostics>
|
|
318
329
|
handleServerlessRequest(req: JsServerlessRequest, onStreamEvent: (...args: any[]) => any, cancelToken: CancellationToken, config: JsServeConfig): Promise<JsServerlessResponseHead>
|
|
319
330
|
}
|
package/index.js
CHANGED
|
@@ -310,7 +310,7 @@ if (!nativeBinding) {
|
|
|
310
310
|
throw new Error(`Failed to load native binding`)
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
const { ActorContext, NapiActorFactory, CancellationToken, ConnHandle, JsNativeDatabase, Kv, Queue, QueueMessage, CoreRegistry, Schedule, WebSocket } = nativeBinding
|
|
313
|
+
const { ActorContext, NapiActorFactory, CancellationToken, ConnHandle, JsNativeDatabase, Kv, Queue, QueueMessage, CoreRegistry, jsSetEventloopLagQuantile, jsSetEventloopUtilization, jsSetEventloopHeartbeatTsMs, jsAddProcessCpuSeconds, jsSetProcessResidentMemoryBytes, jsSetHeapBytes, jsObserveGcDuration, jsSetActiveHandles, jsSetActiveRequests, Schedule, WebSocket } = nativeBinding
|
|
314
314
|
|
|
315
315
|
module.exports.ActorContext = ActorContext
|
|
316
316
|
module.exports.NapiActorFactory = NapiActorFactory
|
|
@@ -321,5 +321,14 @@ module.exports.Kv = Kv
|
|
|
321
321
|
module.exports.Queue = Queue
|
|
322
322
|
module.exports.QueueMessage = QueueMessage
|
|
323
323
|
module.exports.CoreRegistry = CoreRegistry
|
|
324
|
+
module.exports.jsSetEventloopLagQuantile = jsSetEventloopLagQuantile
|
|
325
|
+
module.exports.jsSetEventloopUtilization = jsSetEventloopUtilization
|
|
326
|
+
module.exports.jsSetEventloopHeartbeatTsMs = jsSetEventloopHeartbeatTsMs
|
|
327
|
+
module.exports.jsAddProcessCpuSeconds = jsAddProcessCpuSeconds
|
|
328
|
+
module.exports.jsSetProcessResidentMemoryBytes = jsSetProcessResidentMemoryBytes
|
|
329
|
+
module.exports.jsSetHeapBytes = jsSetHeapBytes
|
|
330
|
+
module.exports.jsObserveGcDuration = jsObserveGcDuration
|
|
331
|
+
module.exports.jsSetActiveHandles = jsSetActiveHandles
|
|
332
|
+
module.exports.jsSetActiveRequests = jsSetActiveRequests
|
|
324
333
|
module.exports.Schedule = Schedule
|
|
325
334
|
module.exports.WebSocket = WebSocket
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivetkit/rivetkit-napi",
|
|
3
|
-
"version": "2.3.0-rc.
|
|
3
|
+
"version": "2.3.0-rc.7",
|
|
4
4
|
"description": "Native N-API addon for RivetKit providing envoy client and SQLite access",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "index.js",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@napi-rs/cli": "^2.18.4",
|
|
46
|
-
"@rivetkit/engine-envoy-protocol": "2.3.0-rc.
|
|
46
|
+
"@rivetkit/engine-envoy-protocol": "2.3.0-rc.7"
|
|
47
47
|
},
|
|
48
48
|
"optionalDependencies": {
|
|
49
|
-
"@rivetkit/rivetkit-napi-darwin-arm64": "2.3.0-rc.
|
|
50
|
-
"@rivetkit/rivetkit-napi-darwin-x64": "2.3.0-rc.
|
|
51
|
-
"@rivetkit/rivetkit-napi-linux-arm64-gnu": "2.3.0-rc.
|
|
52
|
-
"@rivetkit/rivetkit-napi-linux-arm64-musl": "2.3.0-rc.
|
|
53
|
-
"@rivetkit/rivetkit-napi-linux-x64-gnu": "2.3.0-rc.
|
|
54
|
-
"@rivetkit/rivetkit-napi-linux-x64-musl": "2.3.0-rc.
|
|
55
|
-
"@rivetkit/rivetkit-napi-win32-x64-msvc": "2.3.0-rc.
|
|
49
|
+
"@rivetkit/rivetkit-napi-darwin-arm64": "2.3.0-rc.7",
|
|
50
|
+
"@rivetkit/rivetkit-napi-darwin-x64": "2.3.0-rc.7",
|
|
51
|
+
"@rivetkit/rivetkit-napi-linux-arm64-gnu": "2.3.0-rc.7",
|
|
52
|
+
"@rivetkit/rivetkit-napi-linux-arm64-musl": "2.3.0-rc.7",
|
|
53
|
+
"@rivetkit/rivetkit-napi-linux-x64-gnu": "2.3.0-rc.7",
|
|
54
|
+
"@rivetkit/rivetkit-napi-linux-x64-musl": "2.3.0-rc.7",
|
|
55
|
+
"@rivetkit/rivetkit-napi-win32-x64-msvc": "2.3.0-rc.7"
|
|
56
56
|
}
|
|
57
57
|
}
|