@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
|
@@ -2260,7 +2260,7 @@ function writeRetiredBoundSessionRouteFence(input: RetiredBoundSessionRouteFence
|
|
|
2260
2260
|
export function decodeRetiredBoundSessionRouteFence(bytes: Uint8Array, context: ServiceWireDecoderContext): RetiredBoundSessionRouteFence { const reader = new Reader(bytes); const value = readRetiredBoundSessionRouteFence(reader, context, {}, 0); reader.done("retired-bound-session-route-fence"); return value; }
|
|
2261
2261
|
export function encodeRetiredBoundSessionRouteFence(value: RetiredBoundSessionRouteFence, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeRetiredBoundSessionRouteFence(value, writer, context, {}, 0); return writer.result(); }
|
|
2262
2262
|
|
|
2263
|
-
export type SessionRelocationRouteUpdate = { readonly action: "commit"; readonly previousAuthorityOwnerGeneration: NonzeroU64; readonly targetAuthorityOwnerGeneration: NonzeroU64; readonly targetNodeRid: Rid; readonly targetNodeGeneration: NonzeroU64 } | { readonly action: "abort"; readonly currentAuthorityOwnerGeneration: NonzeroU64 };
|
|
2263
|
+
export type SessionRelocationRouteUpdate = { readonly action: "commit"; readonly previousAuthorityOwnerGeneration: NonzeroU64; readonly targetAuthorityOwnerGeneration: NonzeroU64; readonly targetNodeRid: Rid; readonly targetNodeGeneration: NonzeroU64; readonly targetOwnerLeaseGeneration: NonzeroU64 } | { readonly action: "abort"; readonly currentAuthorityOwnerGeneration: NonzeroU64 };
|
|
2264
2264
|
|
|
2265
2265
|
function readSessionRelocationRouteUpdate(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): SessionRelocationRouteUpdate {
|
|
2266
2266
|
void context; void enclosing; void flags;
|
|
@@ -2280,6 +2280,9 @@ function readSessionRelocationRouteUpdate(reader: Reader, context: ServiceWireDe
|
|
|
2280
2280
|
value["targetNodeGeneration"] = readNonzeroU64(body, context, value, flags);
|
|
2281
2281
|
|
|
2282
2282
|
|
|
2283
|
+
value["targetOwnerLeaseGeneration"] = readNonzeroU64(body, context, value, flags);
|
|
2284
|
+
|
|
2285
|
+
|
|
2283
2286
|
} else if (same(value["action"], "abort")) {
|
|
2284
2287
|
value["currentAuthorityOwnerGeneration"] = readNonzeroU64(body, context, value, flags);
|
|
2285
2288
|
|
|
@@ -2313,8 +2316,12 @@ function writeSessionRelocationRouteUpdate(input: SessionRelocationRouteUpdate,
|
|
|
2313
2316
|
|
|
2314
2317
|
|
|
2315
2318
|
writeNonzeroU64(numeric(value["targetNodeGeneration"]), body, context, value, flags);
|
|
2319
|
+
if (value["targetOwnerLeaseGeneration"] === undefined) fail("targetOwnerLeaseGeneration required");
|
|
2320
|
+
|
|
2321
|
+
|
|
2322
|
+
writeNonzeroU64(numeric(value["targetOwnerLeaseGeneration"]), body, context, value, flags);
|
|
2316
2323
|
} else if (same(value["action"], "abort")) {
|
|
2317
|
-
if (value["previousAuthorityOwnerGeneration"] !== undefined || value["targetAuthorityOwnerGeneration"] !== undefined || value["targetNodeRid"] !== undefined || value["targetNodeGeneration"] !== undefined) fail("session-relocation-route-update discriminator agreement");
|
|
2324
|
+
if (value["previousAuthorityOwnerGeneration"] !== undefined || value["targetAuthorityOwnerGeneration"] !== undefined || value["targetNodeRid"] !== undefined || value["targetNodeGeneration"] !== undefined || value["targetOwnerLeaseGeneration"] !== undefined) fail("session-relocation-route-update discriminator agreement");
|
|
2318
2325
|
if (value["currentAuthorityOwnerGeneration"] === undefined) fail("currentAuthorityOwnerGeneration required");
|
|
2319
2326
|
|
|
2320
2327
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// <auto-generated> DO NOT EDIT. schema-sha256:
|
|
1
|
+
// <auto-generated> DO NOT EDIT. schema-sha256: 6d5af5cdfeff1a66c4249f2cc3b93236fa0ba07d6458d7633ef3f45e77a27d4e
|
|
2
2
|
export interface ServiceWireRouteFence { readonly id: string; readonly generation: bigint; readonly targetNodeRid: Uint8Array; readonly targetNodeGeneration: bigint; readonly expectedAuthorityOwnerGeneration: bigint; readonly expectedOwnerLeaseGeneration: bigint; }
|
|
3
3
|
export interface ApplicationPayloadEnvelopeV1 { readonly packetName: string; readonly contentType: string; readonly payload: Uint8Array; }
|
|
4
4
|
export interface ActorJoin28 { readonly correlation: bigint; readonly actor: ServiceWireRouteFence; readonly entry: boolean; readonly targetSpot: ServiceWireRouteFence; readonly payload?: ApplicationPayloadEnvelopeV1; }
|
|
@@ -96,7 +96,7 @@ export interface ServiceWireRequestSourceFence { readonly sourceOwnerId:string;r
|
|
|
96
96
|
export interface ServiceWireAuthorityFence { readonly objectGeneration:bigint;readonly ownerId:string;readonly authorityOwnerGeneration:bigint;readonly leaseGeneration:bigint;readonly storeVersion:string; }
|
|
97
97
|
export type ServiceWireRelocationRole="source"|"target"|"coordinator";
|
|
98
98
|
export type ServiceWireReplyRelayContext={readonly contextKind:"coldActivation";readonly completionKind:"readyBarrier"|"activationFailure";readonly authority:ServiceWireAuthorityFence}|{readonly contextKind:"maintenanceRelocation";readonly relocation:ServiceWireRelocationId;readonly targetAttemptGeneration:bigint;readonly coordinator:ServiceWireCoordinatorFence;readonly participantId:bigint;readonly sequence:bigint};
|
|
99
|
-
export type ServiceWireSessionRouteUpdate={readonly action:"commit";readonly previousAuthorityOwnerGeneration:bigint;readonly targetAuthorityOwnerGeneration:bigint;readonly targetNodeRid:Uint8Array;readonly targetNodeGeneration:bigint}|{readonly action:"abort";readonly currentAuthorityOwnerGeneration:bigint};
|
|
99
|
+
export type ServiceWireSessionRouteUpdate={readonly action:"commit";readonly previousAuthorityOwnerGeneration:bigint;readonly targetAuthorityOwnerGeneration:bigint;readonly targetNodeRid:Uint8Array;readonly targetNodeGeneration:bigint;readonly targetOwnerLeaseGeneration:bigint}|{readonly action:"abort";readonly currentAuthorityOwnerGeneration:bigint};
|
|
100
100
|
export interface ReplyRelay33 {readonly operation:ServiceWireOperationId;readonly replyRouteId:bigint;readonly context:ServiceWireReplyRelayContext;readonly terminalResult:number;readonly failureCode:number;readonly payload?:ApplicationPayloadEnvelopeV1;}
|
|
101
101
|
export interface ReplyRelayAck46 {readonly relocation:ServiceWireRelocationId;readonly coordinator:ServiceWireCoordinatorFence;readonly operation:ServiceWireOperationId;readonly replyRouteId:bigint;readonly requestSource:ServiceWireRequestSourceFence;readonly status:"terminalReceived"|"alreadyTerminal";}
|
|
102
102
|
export interface RelocationReady30 {readonly relocation:ServiceWireRelocationId;readonly targetAttemptGeneration:bigint;readonly coordinator:ServiceWireCoordinatorFence;readonly target:ServiceWireTargetFence;readonly object:RelocationObjectIdentity;readonly senderRole:ServiceWireRelocationRole;}
|
|
@@ -128,8 +128,8 @@ function b3WriteContext(out:number[],v:ServiceWireReplyRelayContext):void{out.pu
|
|
|
128
128
|
function b3ReadContext(bytes:Uint8Array,at:{value:number}):ServiceWireReplyRelayContext{const kind=read8(bytes,at),end=boundedEnd(bytes,at,read16(bytes,at),"reply context");let value:ServiceWireReplyRelayContext;if(kind===1){const completion=read8(bytes,at),inner=boundedEnd(bytes,at,read16(bytes,at),"cold activation");if(completion<1||completion>2)throw new RangeError("completion kind");const authority=b3ReadAuthority(bytes,at);exactEnd(at,inner,"cold activation");value={contextKind:"coldActivation",completionKind:completion===1?"readyBarrier":"activationFailure",authority};}else if(kind===2)value={contextKind:"maintenanceRelocation",relocation:b3ReadId(bytes,at,"relocation"),targetAttemptGeneration:nonzero64(bytes,at,"target attempt"),coordinator:b3ReadCoordinator(bytes,at),participantId:nonzero64(bytes,at,"participant"),sequence:nonzero64(bytes,at,"sequence")};else throw new RangeError("reply context kind");exactEnd(at,end,"reply context");return value;}
|
|
129
129
|
const b3FailureResults=new Map<number,number>([[1,102],[2,105],[3,107],[4,107],[5,105],[6,102],[7,107],[8,102],[9,102],[10,102],[11,102],[12,104],[13,105],[14,102],[15,106],[16,104],[17,105],[18,106],[19,105],[20,105],[21,107],[22,106],[33,107],[34,107],[35,105]]);
|
|
130
130
|
function b3ValidTerminal(result:number,failure:number,payload:boolean):void{const boundary=[101,103,108,109,110,111,112,113];if(result===0){if(failure!==0)throw new RangeError("terminal failure");return;}if(payload)throw new RangeError("failure payload");if(boundary.includes(result)){if(failure!==0)throw new RangeError("boundary failure");return;}if(b3FailureResults.get(failure)!==result)throw new RangeError("typed failure");}
|
|
131
|
-
function b3WriteRoute(out:number[],v:ServiceWireSessionRouteUpdate):void{out.push(v.action==="commit"?1:2);body16(out,b=>{if(v.action==="commit"){if(v.previousAuthorityOwnerGeneration===0n||v.targetAuthorityOwnerGeneration===0n||v.targetNodeGeneration===0n)throw new RangeError("route commit");u64(b,v.previousAuthorityOwnerGeneration);u64(b,v.targetAuthorityOwnerGeneration);rid(b,v.targetNodeRid);u64(b,v.targetNodeGeneration);}else{if(v.currentAuthorityOwnerGeneration===0n)throw new RangeError("route abort");u64(b,v.currentAuthorityOwnerGeneration);}});}
|
|
132
|
-
function b3ReadRoute(bytes:Uint8Array,at:{value:number}):ServiceWireSessionRouteUpdate{const action=read8(bytes,at),end=boundedEnd(bytes,at,read16(bytes,at),"session route");let value:ServiceWireSessionRouteUpdate;if(action===1)value={action:"commit",previousAuthorityOwnerGeneration:nonzero64(bytes,at,"previous authority"),targetAuthorityOwnerGeneration:nonzero64(bytes,at,"target authority"),targetNodeRid:readRid(bytes,at),targetNodeGeneration:nonzero64(bytes,at,"target node")};else if(action===2)value={action:"abort",currentAuthorityOwnerGeneration:nonzero64(bytes,at,"current authority")};else throw new RangeError("route action");exactEnd(at,end,"session route");return value;}
|
|
131
|
+
function b3WriteRoute(out:number[],v:ServiceWireSessionRouteUpdate):void{out.push(v.action==="commit"?1:2);body16(out,b=>{if(v.action==="commit"){if(v.previousAuthorityOwnerGeneration===0n||v.targetAuthorityOwnerGeneration===0n||v.targetNodeGeneration===0n||v.targetOwnerLeaseGeneration===0n)throw new RangeError("route commit");u64(b,v.previousAuthorityOwnerGeneration);u64(b,v.targetAuthorityOwnerGeneration);rid(b,v.targetNodeRid);u64(b,v.targetNodeGeneration);u64(b,v.targetOwnerLeaseGeneration);}else{if(v.currentAuthorityOwnerGeneration===0n)throw new RangeError("route abort");u64(b,v.currentAuthorityOwnerGeneration);}});}
|
|
132
|
+
function b3ReadRoute(bytes:Uint8Array,at:{value:number}):ServiceWireSessionRouteUpdate{const action=read8(bytes,at),end=boundedEnd(bytes,at,read16(bytes,at),"session route");let value:ServiceWireSessionRouteUpdate;if(action===1)value={action:"commit",previousAuthorityOwnerGeneration:nonzero64(bytes,at,"previous authority"),targetAuthorityOwnerGeneration:nonzero64(bytes,at,"target authority"),targetNodeRid:readRid(bytes,at),targetNodeGeneration:nonzero64(bytes,at,"target node"),targetOwnerLeaseGeneration:nonzero64(bytes,at,"target lease")};else if(action===2)value={action:"abort",currentAuthorityOwnerGeneration:nonzero64(bytes,at,"current authority")};else throw new RangeError("route action");exactEnd(at,end,"session route");return value;}
|
|
133
133
|
function b3WriteSession(out:number[],v:{readonly sessionOwnerNodeRid:Uint8Array;readonly sessionOwnerNodeGeneration:bigint;readonly sessionOwnerId:string;readonly sessionOwnerLeaseGeneration:bigint;readonly sessionRid:Uint8Array;readonly bindingGeneration:bigint}):void{rid(out,v.sessionOwnerNodeRid);if(v.sessionOwnerNodeGeneration===0n||v.sessionOwnerLeaseGeneration===0n||v.bindingGeneration===0n)throw new RangeError("session");u64(out,v.sessionOwnerNodeGeneration);text8(out,v.sessionOwnerId);u64(out,v.sessionOwnerLeaseGeneration);rid(out,v.sessionRid);u64(out,v.bindingGeneration);}
|
|
134
134
|
function b3ReadSession(bytes:Uint8Array,at:{value:number}){return{sessionOwnerNodeRid:readRid(bytes,at),sessionOwnerNodeGeneration:nonzero64(bytes,at,"session owner node"),sessionOwnerId:readText8(bytes,at),sessionOwnerLeaseGeneration:nonzero64(bytes,at,"session owner lease"),sessionRid:readRid(bytes,at),bindingGeneration:nonzero64(bytes,at,"binding generation")};}
|
|
135
135
|
function b3Finish(at:{value:number},bytes:Uint8Array,name:string):void{exactEnd(at,bytes.length,name);}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ActorRef, RoutingId, ZLinkActor, ZLinkActorJoinOperationId } from '../../contracts';
|
|
2
2
|
import type { ZLinkRemoteBoundSessionTarget } from '../actors/actor-runtime-state';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ZLinkDeferredJoinCompletion } from '../actors/deferred-join-completion';
|
|
4
4
|
import type { ZLinkActorRequestTerminal } from './spot-actor-packet-dispatch';
|
|
5
5
|
|
|
6
6
|
const ADMISSION_RETENTION_MS = 30_000;
|
|
@@ -57,7 +57,7 @@ export interface ZLinkFormalRemoteActorAdmissionOutcome {
|
|
|
57
57
|
readonly actorRef: ActorRef;
|
|
58
58
|
readonly reply?: Buffer;
|
|
59
59
|
readonly replyContentType?: string;
|
|
60
|
-
readonly
|
|
60
|
+
readonly deferredJoinCompletion?: ZLinkDeferredJoinCompletion;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export interface ZLinkFormalRemoteActorAdmissionFailure {
|
|
@@ -282,9 +282,9 @@ export class ZLinkFormalRemoteActorAdmissionRegistry {
|
|
|
282
282
|
...(outcome.replyContentType === undefined
|
|
283
283
|
? {}
|
|
284
284
|
: { replyContentType: outcome.replyContentType }),
|
|
285
|
-
...(outcome.
|
|
285
|
+
...(outcome.deferredJoinCompletion === undefined
|
|
286
286
|
? {}
|
|
287
|
-
: {
|
|
287
|
+
: { deferredJoinCompletion: outcome.deferredJoinCompletion })
|
|
288
288
|
};
|
|
289
289
|
entry.resolveResult(entry.result);
|
|
290
290
|
if (!outcome.accepted) {
|
|
@@ -314,7 +314,7 @@ export class ZLinkFormalRemoteActorAdmissionRegistry {
|
|
|
314
314
|
entry.actor = actor;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
-
|
|
317
|
+
attachDeferredJoinCompletion(transferId: string, root: ZLinkDeferredJoinCompletion): void {
|
|
318
318
|
const entry = this.admissions.get(transferId);
|
|
319
319
|
if (
|
|
320
320
|
entry === undefined ||
|
|
@@ -325,7 +325,7 @@ export class ZLinkFormalRemoteActorAdmissionRegistry {
|
|
|
325
325
|
) {
|
|
326
326
|
throw new Error(`Remote actor admission '${transferId}' cannot attach deferred recovery.`);
|
|
327
327
|
}
|
|
328
|
-
entry.result = { ...entry.result,
|
|
328
|
+
entry.result = { ...entry.result, deferredJoinCompletion: root };
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
abort(transferId: string): void {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RoutingId, ZLinkActor } from '../../contracts';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ZLinkDeferredJoinCompletion } from '../actors';
|
|
3
3
|
import type { ZLinkActorHandoffPacket } from '../actors/actor-handoff';
|
|
4
4
|
import { ZLinkStateLane } from '../execution/state-lane';
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ export interface ZLinkFormalRemoteActorTransfer {
|
|
|
8
8
|
readonly spotId: RoutingId;
|
|
9
9
|
readonly transferId: string;
|
|
10
10
|
readonly handoffBacklog: readonly ZLinkActorHandoffPacket[];
|
|
11
|
-
readonly
|
|
11
|
+
readonly deferredJoinCompletion?: ZLinkDeferredJoinCompletion;
|
|
12
12
|
readonly targetLifecycleCompleted: Promise<void>;
|
|
13
13
|
readonly sourceLeaveSubmitted: Promise<boolean>;
|
|
14
14
|
}
|
|
@@ -43,7 +43,7 @@ export class ZLinkFormalRemoteActorTransferRegistry {
|
|
|
43
43
|
readonly spotId: RoutingId;
|
|
44
44
|
readonly transferId: string;
|
|
45
45
|
readonly handoffBacklog: readonly ZLinkActorHandoffPacket[];
|
|
46
|
-
readonly
|
|
46
|
+
readonly deferredJoinCompletion?: ZLinkDeferredJoinCompletion;
|
|
47
47
|
}): ZLinkFormalRemoteActorTransfer {
|
|
48
48
|
const existingByActor = this.transfers.get(input.actor.context.actorId)?.transfer;
|
|
49
49
|
if (existingByActor !== undefined) {
|