@zlink-systems/framework 0.25.0 → 0.26.0
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/dist/.tsbuildinfo +1 -1
- package/dist/contracts/Channels/IZLinkFanoutClient.d.ts +0 -6
- package/dist/contracts/RouteMesh/RuntimeTopology.d.ts +8 -0
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +1 -0
- package/dist/runtime/activation-admission.d.ts +29 -0
- package/dist/runtime/activation-admission.js +61 -0
- package/dist/runtime/actors/actor-context.js +6 -6
- package/dist/runtime/actors/actor-handoff.d.ts +9 -3
- package/dist/runtime/actors/actor-handoff.js +28 -17
- package/dist/runtime/actors/actor-local-native-join.js +2 -18
- package/dist/runtime/actors/actor-remote-joiner.d.ts +2 -2
- package/dist/runtime/actors/actor-remote-joiner.js +6 -8
- package/dist/runtime/actors/actor-runtime-contracts.d.ts +4 -2
- package/dist/runtime/actors/actor-source-transfer.d.ts +5 -5
- package/dist/runtime/actors/deferred-join-completion.d.ts +14 -0
- package/dist/runtime/actors/deferred-join-completion.js +20 -0
- package/dist/runtime/actors/index.d.ts +1 -1
- package/dist/runtime/actors/index.js +15 -5
- package/dist/runtime/admission.d.ts +5 -1
- package/dist/runtime/admission.js +4 -0
- package/dist/runtime/backend/contracts/index.d.ts +2 -10
- package/dist/runtime/backend/mesh-actor-session-node-adapter.js +2 -9
- package/dist/runtime/backend/node/node-backend-adapter-factory.d.ts +1 -2
- package/dist/runtime/backend/node/node-backend-adapter-factory.js +4 -18
- package/dist/runtime/backend/node/node-backend-adapter-support.d.ts +6 -3
- package/dist/runtime/backend/node/node-backend-adapter-support.js +12 -28
- package/dist/runtime/backend/node/node-event-loop-poller.d.ts +1 -1
- package/dist/runtime/backend/node/node-event-loop-poller.js +8 -2
- package/dist/runtime/backend/node/node-raw-binding-port.d.ts +1 -1
- package/dist/runtime/backend/node/node-raw-binding-port.js +11 -3
- package/dist/runtime/backend/node/node-raw-mesh-backend.d.ts +12 -9
- package/dist/runtime/backend/node/node-raw-mesh-backend.js +61 -29
- package/dist/runtime/backend/node/node-socket-backend-adapter.js +1 -1
- package/dist/runtime/backend/raw-binding-port.d.ts +12 -0
- package/dist/runtime/channels/channel-clients.d.ts +0 -1
- package/dist/runtime/channels/channel-clients.js +0 -8
- package/dist/runtime/channels/channel-outbound-operations.js +2 -10
- package/dist/runtime/channels/channel-runtime-manager.d.ts +2 -5
- package/dist/runtime/channels/channel-runtime-manager.js +1 -12
- package/dist/runtime/channels/channel-socket-registry.d.ts +17 -4
- package/dist/runtime/channels/channel-socket-registry.js +49 -62
- package/dist/runtime/channels/channel-transports.d.ts +0 -3
- package/dist/runtime/channels/fanout-location-runtime.js +3 -9
- package/dist/runtime/execution/index.d.ts +18 -8
- package/dist/runtime/execution/index.js +55 -29
- package/dist/runtime/execution/serial-execution-queue.d.ts +5 -6
- package/dist/runtime/execution/serial-execution-queue.js +49 -15
- package/dist/runtime/foundation/listener-records.d.ts +11 -0
- package/dist/runtime/foundation/listener-records.js +20 -0
- package/dist/runtime/foundation/raw-service-mesh-runtime.d.ts +10 -21
- package/dist/runtime/foundation/raw-service-mesh-runtime.js +66 -392
- package/dist/runtime/foundation/service-authority-payload-codec.d.ts +1 -0
- package/dist/runtime/foundation/service-authority-payload-codec.js +8 -0
- package/dist/runtime/foundation/service-maintenance-runtime.js +23 -2
- package/dist/runtime/foundation/service-relocation-coordinator.d.ts +9 -0
- package/dist/runtime/foundation/service-relocation-coordinator.js +14 -1
- package/dist/runtime/foundation/service-relocation-object-owner.d.ts +8 -0
- package/dist/runtime/foundation/service-relocation-object-owner.js +16 -4
- package/dist/runtime/foundation/service-session-binding-ingress-port.d.ts +6 -13
- package/dist/runtime/foundation/service-stateful-runtime.d.ts +10 -7
- package/dist/runtime/foundation/service-stateful-runtime.js +100 -60
- package/dist/runtime/foundation/service-stateful-wire-codec.d.ts +9 -4
- package/dist/runtime/foundation/service-stateful-wire-codec.js +153 -90
- package/dist/runtime/foundation/service-topology-registry.d.ts +1 -2
- package/dist/runtime/foundation/service-topology-registry.js +6 -30
- package/dist/runtime/host/actor-transfer-runtime.d.ts +17 -15
- package/dist/runtime/host/actor-transfer-runtime.js +73 -86
- package/dist/runtime/host/index.d.ts +6 -2
- package/dist/runtime/host/index.js +63 -37
- package/dist/runtime/host/remote-bound-session-relay.js +4 -3
- package/dist/runtime/host/route-mesh-runtime.d.ts +2 -0
- package/dist/runtime/host/route-mesh-runtime.js +7 -5
- package/dist/runtime/host/service-relocation-host-runtime.d.ts +50 -8
- package/dist/runtime/host/service-relocation-host-runtime.js +343 -270
- package/dist/runtime/host/spot-runtime-options-factory.d.ts +7 -4
- package/dist/runtime/host/spot-runtime-options-factory.js +4 -8
- package/dist/runtime/host/stateful-authority-route-runtime.js +6 -2
- package/dist/runtime/host/user-spot-creation-coordinator.d.ts +11 -3
- package/dist/runtime/host/user-spot-creation-coordinator.js +85 -87
- package/dist/runtime/locations/in-memory-provider-location-store.js +8 -6
- package/dist/runtime/locations/lifecycle.d.ts +1 -1
- package/dist/runtime/locations/lifecycle.js +2 -2
- package/dist/runtime/locations/resolvers.js +7 -2
- package/dist/runtime/locations/spot-location-claims.d.ts +2 -2
- package/dist/runtime/locations/spot-location-claims.js +3 -27
- package/dist/runtime/protocol/service_wire_codec.generated.d.ts +1 -0
- package/dist/runtime/protocol/service_wire_codec.generated.js +5 -1
- package/dist/runtime/protocol/service_wire_pilot_codec.generated.d.ts +1 -0
- package/dist/runtime/protocol/service_wire_pilot_codec.generated.js +3 -2
- package/dist/runtime/spots/formal-remote-actor-admission-registry.d.ts +3 -3
- package/dist/runtime/spots/formal-remote-actor-admission-registry.js +4 -4
- package/dist/runtime/spots/formal-remote-actor-transfer-registry.d.ts +3 -3
- package/dist/runtime/spots/index.d.ts +25 -19
- package/dist/runtime/spots/index.js +207 -205
- package/dist/runtime/spots/spot-activation-registry.d.ts +4 -2
- package/dist/runtime/spots/spot-activation-registry.js +34 -31
- package/dist/runtime/spots/spot-activation-state.d.ts +2 -11
- package/dist/runtime/spots/spot-activation-state.js +4 -17
- package/dist/runtime/spots/spot-activation.d.ts +8 -6
- package/dist/runtime/spots/spot-activation.js +54 -49
- package/dist/runtime/spots/spot-actor-admission-coordinator.d.ts +1 -1
- package/dist/runtime/spots/spot-actor-admission-coordinator.js +1 -1
- package/dist/runtime/spots/spot-actor-join-dispatch.d.ts +2 -2
- package/dist/runtime/spots/spot-actor-join-dispatch.js +3 -5
- package/dist/runtime/spots/spot-actor-lifecycle-drain.js +2 -2
- package/dist/runtime/spots/spot-actor-membership.d.ts +4 -0
- package/dist/runtime/spots/spot-actor-membership.js +26 -12
- package/dist/runtime/spots/spot-entry-activation.d.ts +1 -2
- package/dist/runtime/spots/spot-entry-activation.js +0 -1
- package/dist/runtime/spots/spot-manager-public.js +1 -1
- package/dist/runtime/spots/spot-native-actor-join-admission.d.ts +1 -1
- package/dist/runtime/spots/spot-native-actor-join-admission.js +2 -2
- package/dist/runtime/spots/spot-node-runtime-manager.d.ts +5 -5
- package/dist/runtime/spots/spot-node-runtime-manager.js +7 -11
- package/dist/runtime/spots/spot-outbound.js +1 -29
- package/dist/runtime/spots/spot-routed-actor-admission.d.ts +1 -0
- package/dist/runtime/spots/spot-routed-actor-admission.js +10 -0
- package/dist/runtime/spots/spot-routed-frame-dispatch.d.ts +2 -6
- package/dist/runtime/spots/spot-routed-frame-dispatch.js +2 -70
- package/dist/runtime/spots/spot-runtime-ports.d.ts +3 -5
- package/dist/runtime/spots/spot-serial-executor.d.ts +5 -0
- package/dist/runtime/spots/spot-serial-executor.js +8 -1
- package/dist/runtime/spots/spot-serial-turn-executor.d.ts +3 -0
- package/dist/runtime/spots/spot-serial-turn-executor.js +8 -4
- package/dist/runtime/streams/actor-session-binding-registry.d.ts +13 -15
- package/dist/runtime/streams/actor-session-binding-registry.js +19 -171
- package/dist/runtime/streams/actor-session-binding-runtime-owner.d.ts +3 -4
- package/dist/runtime/streams/bound-session-service.js +1 -18
- package/dist/runtime/streams/index.d.ts +2 -0
- package/dist/runtime/streams/index.js +19 -19
- package/dist/runtime/streams/session-serial-executor.js +2 -2
- package/package.json +3 -3
- package/src/contracts/Channels/IZLinkFanoutClient.ts +0 -7
- package/src/contracts/RouteMesh/RuntimeTopology.ts +10 -0
- package/src/internal.ts +1 -0
- package/src/runtime/activation-admission.ts +78 -0
- package/src/runtime/actors/actor-context.ts +6 -6
- package/src/runtime/actors/actor-handoff.ts +31 -23
- package/src/runtime/actors/actor-local-native-join.ts +3 -42
- package/src/runtime/actors/actor-remote-joiner.ts +6 -25
- package/src/runtime/actors/actor-runtime-contracts.ts +4 -10
- package/src/runtime/actors/actor-source-transfer.ts +5 -18
- package/src/runtime/actors/deferred-join-completion.ts +40 -0
- package/src/runtime/actors/index.ts +22 -9
- package/src/runtime/admission.ts +5 -1
- package/src/runtime/backend/contracts/index.ts +2 -13
- package/src/runtime/backend/mesh-actor-session-node-adapter.ts +2 -10
- package/src/runtime/backend/node/node-backend-adapter-factory.ts +5 -25
- package/src/runtime/backend/node/node-backend-adapter-support.ts +9 -29
- package/src/runtime/backend/node/node-event-loop-poller.ts +14 -2
- package/src/runtime/backend/node/node-raw-binding-port.ts +17 -3
- package/src/runtime/backend/node/node-raw-mesh-backend.ts +65 -32
- package/src/runtime/backend/node/node-socket-backend-adapter.ts +2 -2
- package/src/runtime/backend/raw-binding-port.ts +13 -0
- package/src/runtime/channels/channel-clients.ts +0 -11
- package/src/runtime/channels/channel-outbound-operations.ts +3 -11
- package/src/runtime/channels/channel-runtime-manager.ts +4 -15
- package/src/runtime/channels/channel-socket-registry.ts +69 -71
- package/src/runtime/channels/channel-transports.ts +0 -3
- package/src/runtime/channels/fanout-location-runtime.ts +4 -16
- package/src/runtime/execution/index.ts +68 -30
- package/src/runtime/execution/serial-execution-queue.ts +52 -20
- package/src/runtime/foundation/listener-records.ts +21 -0
- package/src/runtime/foundation/raw-service-mesh-runtime.ts +66 -466
- package/src/runtime/foundation/service-authority-payload-codec.ts +10 -0
- package/src/runtime/foundation/service-maintenance-runtime.ts +30 -9
- package/src/runtime/foundation/service-relocation-coordinator.ts +13 -0
- package/src/runtime/foundation/service-relocation-object-owner.ts +18 -5
- package/src/runtime/foundation/service-session-binding-ingress-port.ts +6 -14
- package/src/runtime/foundation/service-stateful-runtime.ts +151 -89
- package/src/runtime/foundation/service-stateful-wire-codec.ts +203 -121
- package/src/runtime/foundation/service-topology-registry.ts +8 -48
- package/src/runtime/host/actor-transfer-runtime.ts +94 -166
- package/src/runtime/host/index.ts +119 -54
- package/src/runtime/host/remote-bound-session-relay.ts +4 -3
- package/src/runtime/host/route-mesh-runtime.ts +9 -5
- package/src/runtime/host/service-relocation-host-runtime.ts +495 -376
- package/src/runtime/host/spot-runtime-options-factory.ts +24 -13
- package/src/runtime/host/stateful-authority-route-runtime.ts +8 -4
- package/src/runtime/host/user-spot-creation-coordinator.ts +147 -142
- package/src/runtime/locations/in-memory-provider-location-store.ts +11 -7
- package/src/runtime/locations/lifecycle.ts +3 -2
- package/src/runtime/locations/resolvers.ts +19 -13
- package/src/runtime/locations/spot-location-claims.ts +5 -34
- package/src/runtime/protocol/service_wire_codec.generated.ts +9 -2
- package/src/runtime/protocol/service_wire_pilot_codec.generated.ts +4 -4
- package/src/runtime/spots/formal-remote-actor-admission-registry.ts +6 -6
- package/src/runtime/spots/formal-remote-actor-transfer-registry.ts +3 -3
- package/src/runtime/spots/index.ts +341 -295
- package/src/runtime/spots/spot-activation-registry.ts +41 -31
- package/src/runtime/spots/spot-activation-state.ts +4 -16
- package/src/runtime/spots/spot-activation.ts +102 -80
- package/src/runtime/spots/spot-actor-admission-coordinator.ts +2 -2
- package/src/runtime/spots/spot-actor-join-dispatch.ts +6 -7
- package/src/runtime/spots/spot-actor-lifecycle-drain.ts +20 -18
- package/src/runtime/spots/spot-actor-membership.ts +81 -17
- package/src/runtime/spots/spot-entry-activation.ts +0 -3
- package/src/runtime/spots/spot-manager-public.ts +8 -4
- package/src/runtime/spots/spot-native-actor-join-admission.ts +2 -2
- package/src/runtime/spots/spot-node-runtime-manager.ts +12 -18
- package/src/runtime/spots/spot-outbound.ts +4 -47
- package/src/runtime/spots/spot-routed-actor-admission.ts +20 -0
- package/src/runtime/spots/spot-routed-frame-dispatch.ts +6 -76
- package/src/runtime/spots/spot-runtime-ports.ts +6 -17
- package/src/runtime/spots/spot-serial-executor.ts +9 -1
- package/src/runtime/spots/spot-serial-turn-executor.ts +10 -4
- package/src/runtime/streams/actor-session-binding-registry.ts +20 -308
- package/src/runtime/streams/actor-session-binding-runtime-owner.ts +2 -12
- package/src/runtime/streams/bound-session-service.ts +2 -36
- package/src/runtime/streams/index.ts +29 -27
- package/src/runtime/streams/session-serial-executor.ts +2 -2
- package/dist/runtime/actors/deferred-join-accepted-journal.d.ts +0 -47
- package/dist/runtime/actors/deferred-join-accepted-journal.js +0 -992
- package/src/runtime/actors/deferred-join-accepted-journal.ts +0 -1346
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ZLinkListenerRecords } from '../foundation/listener-records';
|
|
1
2
|
import type {
|
|
2
3
|
ActorRef,
|
|
3
4
|
Type,
|
|
@@ -167,6 +168,7 @@ export interface ZLinkStreamSessionNodeRuntimeOptions extends Omit<
|
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
export interface ZLinkStreamRuntimeManagerOptions {
|
|
171
|
+
readonly listenerRecords?: ZLinkListenerRecords;
|
|
170
172
|
readonly registration: ZLinkFrameworkRegistration;
|
|
171
173
|
readonly backendAdapterFactory: ZLinkBackendAdapterFactory;
|
|
172
174
|
readonly context: ZLinkBackendContext;
|
|
@@ -183,14 +185,16 @@ export interface ZLinkStreamRuntimeManagerOptions {
|
|
|
183
185
|
readonly applicationJobQueue?: ApplicationJobQueue;
|
|
184
186
|
}
|
|
185
187
|
|
|
188
|
+
// A STREAM node's native resources, recorded as each one is created. The
|
|
189
|
+
// manager owns them from creation, so `dispose` releases whatever a failed
|
|
190
|
+
// `start` had already opened; an unreleased socket keeps the context from
|
|
191
|
+
// terminating.
|
|
186
192
|
interface ZLinkStartedStreamNode {
|
|
187
193
|
readonly meshName?: string;
|
|
188
|
-
readonly advertisedEndpoint: string;
|
|
189
|
-
readonly runtime: ZLinkStreamSessionNodeRuntimeCore;
|
|
190
194
|
readonly socket: ZLinkBackendStreamSocket;
|
|
191
|
-
readonly
|
|
192
|
-
|
|
193
|
-
|
|
195
|
+
readonly nativeSessionServices: StreamSessionService[];
|
|
196
|
+
monitor?: ZLinkBackendSocketMonitor;
|
|
197
|
+
runtime?: ZLinkStreamSessionNodeRuntimeCore;
|
|
194
198
|
}
|
|
195
199
|
|
|
196
200
|
export class ZLinkStreamRuntimeManager {
|
|
@@ -215,6 +219,12 @@ export class ZLinkStreamRuntimeManager {
|
|
|
215
219
|
const nativeMeshNode = actorDispatchEnabled ? this.options.nativeMeshNode : undefined;
|
|
216
220
|
const meshCompletions = actorDispatchEnabled ? this.options.meshCompletions : undefined;
|
|
217
221
|
const socket = streamAdapter.createStreamSocket(this.options.context);
|
|
222
|
+
const node: ZLinkStartedStreamNode = {
|
|
223
|
+
meshName: applicationMeshName,
|
|
224
|
+
socket,
|
|
225
|
+
nativeSessionServices: []
|
|
226
|
+
};
|
|
227
|
+
this.nodes.set(nodeName, node);
|
|
218
228
|
// Core uses -1 as the explicit unlimited value. The Framework value 0
|
|
219
229
|
// means that it adds no separate STREAM cap, so preserve that meaning
|
|
220
230
|
// when applying the socket option.
|
|
@@ -240,7 +250,6 @@ export class ZLinkStreamRuntimeManager {
|
|
|
240
250
|
`STREAM node '${nodeName}' advertised host requires a TCP endpoint, received '${boundEndpoint}'.`
|
|
241
251
|
);
|
|
242
252
|
}
|
|
243
|
-
const readablePoller = streamAdapter.createReadablePoller(socket);
|
|
244
253
|
const nativeSessionRoutes = new Map<
|
|
245
254
|
string,
|
|
246
255
|
{
|
|
@@ -262,11 +271,12 @@ export class ZLinkStreamRuntimeManager {
|
|
|
262
271
|
const createService = meshNode?.createStreamSessionService;
|
|
263
272
|
if (typeof createService !== 'function' || completions === undefined) continue;
|
|
264
273
|
const service = createService.call(meshNode, socket.nativeInstance as never);
|
|
274
|
+
node.nativeSessionServices.push(service);
|
|
265
275
|
const bindingOwner = actorSessionBindingRuntimeOwner(this.options.bindingRuntime);
|
|
266
276
|
registerServiceSessionBindingIngressPort(service, {
|
|
267
277
|
actorSlot: (actorId, sessionRid) => bindingOwner.actorSlot(actorId, sessionRid),
|
|
268
|
-
retainOutbound: (
|
|
269
|
-
bindingOwner.
|
|
278
|
+
retainOutbound: (actorId, delivery) =>
|
|
279
|
+
bindingOwner.retainRelocationOutbound(actorId, delivery),
|
|
270
280
|
clearOutbound: (actorId, error) => bindingOwner.clearRelocation(actorId, error)
|
|
271
281
|
});
|
|
272
282
|
nativeSessionRoutes.set(meshName, {
|
|
@@ -280,11 +290,15 @@ export class ZLinkStreamRuntimeManager {
|
|
|
280
290
|
? undefined
|
|
281
291
|
: nativeSessionRoutes.get(applicationMeshName)?.service;
|
|
282
292
|
const monitor = monitoringAdapter.openSocketMonitor(socket);
|
|
293
|
+
node.monitor = monitor;
|
|
283
294
|
const sessionType = streamNode.session!;
|
|
284
295
|
const sessionHandlerTypes =
|
|
285
296
|
(streamNode as unknown as Record<symbol, readonly Type[] | undefined>)[
|
|
286
297
|
Symbol.for('@zlink-systems/framework:session-handler-types')
|
|
287
298
|
] ?? [];
|
|
299
|
+
// The runtime disposes the poller, so the poller is created where nothing
|
|
300
|
+
// can fail before the runtime owns it.
|
|
301
|
+
const readablePoller = streamAdapter.createReadablePoller(socket);
|
|
288
302
|
const runtime = new ZLinkStreamSessionNodeRuntimeCore({
|
|
289
303
|
nodeName,
|
|
290
304
|
socket,
|
|
@@ -310,16 +324,9 @@ export class ZLinkStreamRuntimeManager {
|
|
|
310
324
|
sessionHandlerTypes
|
|
311
325
|
)
|
|
312
326
|
});
|
|
327
|
+
node.runtime = runtime;
|
|
313
328
|
runtime.start();
|
|
314
|
-
this.
|
|
315
|
-
meshName: applicationMeshName,
|
|
316
|
-
advertisedEndpoint,
|
|
317
|
-
runtime,
|
|
318
|
-
socket,
|
|
319
|
-
monitor,
|
|
320
|
-
nativeSessionService,
|
|
321
|
-
nativeSessionServices: [...nativeSessionRoutes.values()].map((route) => route.service)
|
|
322
|
-
});
|
|
329
|
+
this.options.listenerRecords?.record('stream', nodeName, advertisedEndpoint);
|
|
323
330
|
}
|
|
324
331
|
}
|
|
325
332
|
|
|
@@ -327,15 +334,12 @@ export class ZLinkStreamRuntimeManager {
|
|
|
327
334
|
const nodes = [...this.nodes.values()];
|
|
328
335
|
this.nodes.clear();
|
|
329
336
|
for (const node of nodes.reverse()) {
|
|
330
|
-
await node.runtime
|
|
331
|
-
const
|
|
332
|
-
node.nativeSessionServices ??
|
|
333
|
-
(node.nativeSessionService === undefined ? [] : [node.nativeSessionService]);
|
|
334
|
-
for (const service of nativeServices) {
|
|
337
|
+
await node.runtime?.dispose();
|
|
338
|
+
for (const service of node.nativeSessionServices) {
|
|
335
339
|
service.shutdown(1000);
|
|
336
340
|
service.close();
|
|
337
341
|
}
|
|
338
|
-
await node.monitor
|
|
342
|
+
await node.monitor?.dispose();
|
|
339
343
|
await node.socket.dispose();
|
|
340
344
|
}
|
|
341
345
|
}
|
|
@@ -344,7 +348,7 @@ export class ZLinkStreamRuntimeManager {
|
|
|
344
348
|
await Promise.all(
|
|
345
349
|
[...this.nodes.values()]
|
|
346
350
|
.filter((node) => node.meshName === meshName)
|
|
347
|
-
.map((node) => node.runtime
|
|
351
|
+
.map((node) => node.runtime?.drainCloseSessions())
|
|
348
352
|
);
|
|
349
353
|
}
|
|
350
354
|
|
|
@@ -352,7 +356,7 @@ export class ZLinkStreamRuntimeManager {
|
|
|
352
356
|
await Promise.all(
|
|
353
357
|
[...this.nodes.values()]
|
|
354
358
|
.filter((node) => node.meshName === undefined)
|
|
355
|
-
.map((node) => node.runtime
|
|
359
|
+
.map((node) => node.runtime?.drainCloseSessions())
|
|
356
360
|
);
|
|
357
361
|
}
|
|
358
362
|
}
|
|
@@ -453,8 +457,6 @@ export class ZLinkStreamBindingRuntime {
|
|
|
453
457
|
relocationSnapshot: (actorId, sealId) => this.routes.relocationSnapshot(actorId, sealId),
|
|
454
458
|
retainRelocationOutbound: (actorId, operation, sealId) =>
|
|
455
459
|
this.routes.retainRelocationOutbound(actorId, operation, sealId),
|
|
456
|
-
admitRelocationOutbound: (claim, operation) =>
|
|
457
|
-
this.routes.admitRelocationOutbound(claim, operation),
|
|
458
460
|
discardRelocationOutbound: (actorId, sealId, error) =>
|
|
459
461
|
this.routes.discardRelocationOutbound(actorId, sealId, error),
|
|
460
462
|
applyRelocation: (...args) => this.routes.applyRelocation(...args),
|
|
@@ -55,8 +55,8 @@ export class ZLinkSessionSerialExecutor {
|
|
|
55
55
|
}
|
|
56
56
|
const boundWork = bindApplicationJobPermit(work);
|
|
57
57
|
return hasApplicationJobPermit()
|
|
58
|
-
? this.scheduler.submitPreAdmitted(boundWork, { lane: '
|
|
59
|
-
: this.scheduler.submit(boundWork, { lane: '
|
|
58
|
+
? this.scheduler.submitPreAdmitted(boundWork, { lane: 'application' })
|
|
59
|
+
: this.scheduler.submit(boundWork, { lane: 'application' });
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
private submit(
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { ActorRef, ZLinkActor, ZLinkActorJoinOperationId, ZLinkBlobReference, ZLinkMessageSerializer, ZLinkRelocationStore } from '../../contracts';
|
|
2
|
-
import type { ZLinkAuthoritySnapshot } from '../locations/internal-location-contracts';
|
|
3
|
-
import type { ZLinkAuthorityStore } from '../locations/internal-store-contracts';
|
|
4
|
-
export type ZLinkDeferredJoinDeliveryCursor = 'prepared' | 'committed' | 'delivered';
|
|
5
|
-
export interface ZLinkDeferredJoinAcceptedRoot {
|
|
6
|
-
readonly authority: ZLinkAuthoritySnapshot;
|
|
7
|
-
readonly reference: ZLinkBlobReference;
|
|
8
|
-
readonly checksumCrc32c: number;
|
|
9
|
-
readonly operationId: ZLinkActorJoinOperationId;
|
|
10
|
-
readonly actor: ActorRef;
|
|
11
|
-
readonly rawReply: Buffer;
|
|
12
|
-
readonly replyContentType?: string;
|
|
13
|
-
readonly cursor: ZLinkDeferredJoinDeliveryCursor;
|
|
14
|
-
}
|
|
15
|
-
export interface ZLinkDeferredJoinRootIdentity {
|
|
16
|
-
readonly authorityKey: string;
|
|
17
|
-
readonly objectKind: 'actor' | 'user_spot' | 'instance_spot';
|
|
18
|
-
readonly objectGeneration: bigint;
|
|
19
|
-
readonly aggregateId: string;
|
|
20
|
-
readonly aggregateGeneration: bigint;
|
|
21
|
-
}
|
|
22
|
-
/** Identifies whether an authority slot points at a deferred Join journal root. */
|
|
23
|
-
export declare function isDeferredJoinAcceptedRootPublication(relocation: ZLinkRelocationStore, reference: string, checksumCrc32c: number, expected: ZLinkDeferredJoinRootIdentity, signal?: AbortSignal): Promise<boolean>;
|
|
24
|
-
/**
|
|
25
|
-
* Keeps a cross-node Accepted Join completion under the Actor authority.
|
|
26
|
-
* Every cursor transition writes and verifies a new immutable root before the
|
|
27
|
-
* authority CAS. A failed callback leaves the committed root available for the
|
|
28
|
-
* next target Actor mailbox retry.
|
|
29
|
-
*/
|
|
30
|
-
export declare class ZLinkDeferredJoinAcceptedJournal {
|
|
31
|
-
private readonly authority;
|
|
32
|
-
private readonly relocation;
|
|
33
|
-
private readonly messageSerializers?;
|
|
34
|
-
constructor(authority: ZLinkAuthorityStore, relocation: ZLinkRelocationStore, messageSerializers?: ReadonlyMap<string, ZLinkMessageSerializer> | undefined);
|
|
35
|
-
prepare(actorId: string, operationId: ZLinkActorJoinOperationId, actor: ActorRef, rawReply: Uint8Array, replyContentType?: string, signal?: AbortSignal, canonicalInventoryDigest?: string): Promise<ZLinkDeferredJoinAcceptedRoot>;
|
|
36
|
-
recover(actorId: string, signal?: AbortSignal): Promise<ZLinkDeferredJoinAcceptedRoot | undefined>;
|
|
37
|
-
markCommitted(root: ZLinkDeferredJoinAcceptedRoot, actor?: ActorRef, signal?: AbortSignal): Promise<ZLinkDeferredJoinAcceptedRoot>;
|
|
38
|
-
markDelivered(root: ZLinkDeferredJoinAcceptedRoot, signal?: AbortSignal): Promise<ZLinkDeferredJoinAcceptedRoot>;
|
|
39
|
-
discardPrepared(root: ZLinkDeferredJoinAcceptedRoot, signal?: AbortSignal): Promise<void>;
|
|
40
|
-
deliver(root: ZLinkDeferredJoinAcceptedRoot, actor: ZLinkActor, actorRef: ActorRef, submitMailbox: <T>(operation: () => Promise<T>) => Promise<T>, signal?: AbortSignal): Promise<ZLinkDeferredJoinAcceptedRoot>;
|
|
41
|
-
private releaseDelivered;
|
|
42
|
-
private moveCursor;
|
|
43
|
-
private readPublished;
|
|
44
|
-
private storeRoot;
|
|
45
|
-
private storeCanonicalRoot;
|
|
46
|
-
private deleteBestEffort;
|
|
47
|
-
}
|