@zlink-systems/framework 0.30.3 → 0.32.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/Actors/ZLinkActor.d.ts +2 -0
- package/dist/contracts/Actors/ZLinkSessionBindingIdentity.d.ts +6 -0
- package/dist/contracts/Actors/ZLinkSessionBindingIdentity.js +2 -0
- package/dist/contracts/Actors/index.d.ts +1 -0
- package/dist/contracts/Actors/index.js +1 -0
- package/dist/contracts/Common/CoreTypes.d.ts +1 -0
- package/dist/contracts/Common/HandlerMessageType.d.ts +8 -0
- package/dist/contracts/Common/HandlerMessageType.js +41 -0
- package/dist/contracts/Common/ZLinkEncodedPayload.d.ts +1 -1
- package/dist/contracts/Common/ZLinkEncodedPayload.js +12 -20
- package/dist/contracts/Common/ZLinkMessage.js +11 -7
- package/dist/contracts/Common/encoded-payload-storage.d.ts +0 -2
- package/dist/contracts/Common/encoded-payload-storage.js +4 -16
- package/dist/contracts/Common/index.d.ts +1 -1
- package/dist/contracts/Common/payload-slab.d.ts +4 -0
- package/dist/contracts/Common/payload-slab.js +30 -0
- package/dist/contracts/Configuration/RegistrationBuilders.js +15 -9
- package/dist/contracts/Configuration/RegistrationTypes.d.ts +19 -0
- package/dist/contracts/Handlers/Contexts.d.ts +1 -0
- package/dist/contracts/Locations/Authority.d.ts +2 -0
- package/dist/internal.d.ts +9 -0
- package/dist/internal.js +23 -1
- package/dist/nest-integration.d.ts +1 -0
- package/dist/nest-integration.js +3 -1
- package/dist/runtime/actors/actor-client.d.ts +6 -2
- package/dist/runtime/actors/actor-client.js +120 -82
- package/dist/runtime/actors/actor-context.js +16 -5
- package/dist/runtime/actors/actor-execution-context.js +2 -2
- package/dist/runtime/actors/actor-handoff.d.ts +12 -1
- package/dist/runtime/actors/actor-handoff.js +79 -34
- package/dist/runtime/actors/actor-join-deferred-scope.js +6 -6
- package/dist/runtime/actors/actor-local-native-join.d.ts +2 -2
- package/dist/runtime/actors/actor-local-native-join.js +19 -17
- package/dist/runtime/actors/actor-mailbox.d.ts +1 -1
- package/dist/runtime/actors/actor-remote-joiner.d.ts +2 -2
- package/dist/runtime/actors/actor-remote-joiner.js +4 -4
- package/dist/runtime/actors/actor-routed-join-transport.d.ts +9 -3
- package/dist/runtime/actors/actor-routed-json-request.d.ts +3 -0
- package/dist/runtime/actors/actor-runtime-contracts.d.ts +2 -2
- package/dist/runtime/actors/actor-runtime-state.d.ts +1 -1
- package/dist/runtime/actors/spot-actor-dispatch.d.ts +9 -5
- package/dist/runtime/actors/spot-actor-dispatch.js +60 -38
- package/dist/runtime/admission.d.ts +6 -4
- package/dist/runtime/admission.js +21 -10
- package/dist/runtime/application-jobs/application-ingress-record-owner.d.ts +1 -0
- package/dist/runtime/application-jobs/application-ingress-record-owner.js +3 -0
- package/dist/runtime/backend/contracts/index.d.ts +26 -10
- package/dist/runtime/backend/mesh-completion-table.d.ts +7 -1
- package/dist/runtime/backend/mesh-completion-table.js +84 -20
- package/dist/runtime/backend/mesh-dispatch-pump.d.ts +19 -6
- package/dist/runtime/backend/mesh-dispatch-pump.js +246 -147
- package/dist/runtime/backend/node/node-backend-adapter-support.d.ts +3 -2
- package/dist/runtime/backend/node/node-backend-adapter-support.js +27 -19
- package/dist/runtime/backend/node/node-dealer-channel-client-transport.d.ts +5 -2
- package/dist/runtime/backend/node/node-dealer-channel-client-transport.js +70 -13
- package/dist/runtime/backend/node/node-event-loop-poller.d.ts +2 -2
- package/dist/runtime/backend/node/node-event-loop-poller.js +4 -3
- package/dist/runtime/backend/node/node-mesh-backend-adapter.js +5 -1
- package/dist/runtime/backend/node/node-raw-binding-port.d.ts +7 -2
- package/dist/runtime/backend/node/node-raw-binding-port.js +99 -63
- package/dist/runtime/backend/node/node-raw-mesh-backend.d.ts +34 -16
- package/dist/runtime/backend/node/node-raw-mesh-backend.js +210 -106
- package/dist/runtime/backend/node/node-socket-backend-adapter.js +20 -6
- package/dist/runtime/backend/raw-binding-port.d.ts +6 -3
- package/dist/runtime/channels/channel-clients.js +3 -3
- package/dist/runtime/channels/channel-dispatch-pipeline.d.ts +11 -7
- package/dist/runtime/channels/channel-dispatch-pipeline.js +40 -22
- package/dist/runtime/channels/channel-dispatch-services.d.ts +3 -1
- package/dist/runtime/channels/channel-dispatch-services.js +7 -6
- package/dist/runtime/channels/channel-dispatchers.d.ts +13 -6
- package/dist/runtime/channels/channel-dispatchers.js +57 -36
- package/dist/runtime/channels/channel-envelope.d.ts +2 -2
- package/dist/runtime/channels/channel-envelope.js +609 -83
- package/dist/runtime/channels/channel-multipart.d.ts +1 -0
- package/dist/runtime/channels/channel-multipart.js +10 -6
- package/dist/runtime/channels/channel-outbound-operations.d.ts +6 -9
- package/dist/runtime/channels/channel-outbound-operations.js +107 -105
- package/dist/runtime/channels/channel-receive-loops.d.ts +9 -7
- package/dist/runtime/channels/channel-receive-loops.js +126 -90
- package/dist/runtime/channels/channel-runtime-lifecycle.d.ts +23 -6
- package/dist/runtime/channels/channel-runtime-lifecycle.js +47 -38
- package/dist/runtime/channels/channel-runtime-manager.d.ts +13 -6
- package/dist/runtime/channels/channel-runtime-manager.js +32 -14
- package/dist/runtime/channels/channel-socket-registry.d.ts +28 -4
- package/dist/runtime/channels/channel-socket-registry.js +9 -1
- package/dist/runtime/channels/channel-transports.d.ts +23 -16
- package/dist/runtime/channels/channel-transports.js +139 -119
- package/dist/runtime/channels/dispatch-error-reporter.d.ts +4 -4
- package/dist/runtime/channels/dispatch-error-reporter.js +5 -5
- package/dist/runtime/channels/fanout-location-runtime.d.ts +1 -1
- package/dist/runtime/channels/local-spot-route-transport.d.ts +5 -2
- package/dist/runtime/channels/local-spot-route-transport.js +15 -18
- package/dist/runtime/channels/router-socket-spot-route-transport.d.ts +6 -3
- package/dist/runtime/channels/router-socket-spot-route-transport.js +33 -19
- package/dist/runtime/channels/source-spot-router.d.ts +6 -3
- package/dist/runtime/channels/source-spot-router.js +34 -23
- package/dist/runtime/channels/spot-node-route-transport.d.ts +6 -3
- package/dist/runtime/channels/spot-node-route-transport.js +23 -17
- package/dist/runtime/channels/spot-route-bridge-transport.d.ts +6 -3
- package/dist/runtime/channels/spot-route-bridge-transport.js +38 -24
- package/dist/runtime/channels/spot-route-dispatch-strategy.d.ts +8 -4
- package/dist/runtime/channels/spot-route-dispatch-strategy.js +36 -23
- package/dist/runtime/diagnostics/dispatch-error-details.js +9 -3
- package/dist/runtime/diagnostics/message-flow-bootstrap.d.ts +1 -0
- package/dist/runtime/diagnostics/message-flow-bootstrap.js +8 -0
- package/dist/runtime/diagnostics/message-flow-delivery.d.ts +47 -0
- package/dist/runtime/diagnostics/message-flow-delivery.js +149 -0
- package/dist/runtime/diagnostics/message-flow-record.d.ts +50 -0
- package/dist/runtime/diagnostics/message-flow-record.js +228 -0
- package/dist/runtime/diagnostics/message-flow-worker.d.ts +1 -0
- package/dist/runtime/diagnostics/message-flow-worker.js +118 -0
- package/dist/runtime/diagnostics/message-flow.d.ts +7 -19
- package/dist/runtime/diagnostics/message-flow.js +42 -290
- package/dist/runtime/diagnostics/runtime-metrics.d.ts +4 -3
- package/dist/runtime/diagnostics/runtime-metrics.js +8 -4
- package/dist/runtime/execution/index.d.ts +1 -0
- package/dist/runtime/execution/index.js +6 -3
- package/dist/runtime/execution/serial-execution-queue.d.ts +26 -13
- package/dist/runtime/execution/serial-execution-queue.js +75 -71
- package/dist/runtime/foundation/durable-service-request.d.ts +12 -3
- package/dist/runtime/foundation/durable-service-request.js +158 -73
- package/dist/runtime/foundation/operation-registry.d.ts +33 -3
- package/dist/runtime/foundation/operation-registry.js +272 -33
- package/dist/runtime/foundation/raw-service-mesh-runtime.d.ts +62 -23
- package/dist/runtime/foundation/raw-service-mesh-runtime.js +373 -194
- package/dist/runtime/foundation/request-runtime.d.ts +17 -0
- package/dist/runtime/foundation/request-runtime.js +163 -0
- package/dist/runtime/foundation/service-discovery-registry.d.ts +4 -0
- package/dist/runtime/foundation/service-discovery-registry.js +6 -0
- package/dist/runtime/foundation/service-liveness-registry.d.ts +1 -1
- package/dist/runtime/foundation/service-mailbox.d.ts +4 -2
- package/dist/runtime/foundation/service-mailbox.js +4 -1
- package/dist/runtime/foundation/service-relocation-object-owner.d.ts +2 -2
- package/dist/runtime/foundation/service-relocation-object-owner.js +12 -5
- package/dist/runtime/foundation/service-runtime-contracts.d.ts +7 -2
- package/dist/runtime/foundation/service-stateful-registry.d.ts +6 -2
- package/dist/runtime/foundation/service-stateful-registry.js +38 -17
- package/dist/runtime/foundation/service-stateful-runtime.d.ts +91 -26
- package/dist/runtime/foundation/service-stateful-runtime.js +245 -120
- package/dist/runtime/foundation/service-stateful-wire-codec.d.ts +3 -0
- package/dist/runtime/foundation/service-stateful-wire-codec.js +15 -0
- package/dist/runtime/foundation/service-topology-registry.d.ts +2 -0
- package/dist/runtime/foundation/service-topology-registry.js +13 -3
- package/dist/runtime/foundation/service-wire-constants.generated.d.ts +1 -0
- package/dist/runtime/foundation/service-wire-constants.generated.js +12 -0
- package/dist/runtime/foundation/service-wire-m6a-codec.d.ts +5 -1
- package/dist/runtime/foundation/service-wire-m6a-codec.js +50 -15
- package/dist/runtime/host/actor-packet-relay.d.ts +5 -6
- package/dist/runtime/host/actor-packet-relay.js +58 -57
- package/dist/runtime/host/actor-placement-coordinator.d.ts +1 -1
- package/dist/runtime/host/actor-runtime-options-factory.d.ts +2 -0
- package/dist/runtime/host/actor-runtime-options-factory.js +3 -2
- package/dist/runtime/host/actor-transfer-runtime.d.ts +3 -3
- package/dist/runtime/host/application-job-queue.d.ts +7 -5
- package/dist/runtime/host/application-job-queue.js +33 -21
- package/dist/runtime/host/bound-session-relay.js +0 -1
- package/dist/runtime/host/channel-runtime-options-factory.d.ts +2 -0
- package/dist/runtime/host/channel-runtime-options-factory.js +1 -0
- package/dist/runtime/host/entry-actor-runtime.d.ts +5 -2
- package/dist/runtime/host/entry-actor-runtime.js +2 -2
- package/dist/runtime/host/index.d.ts +106 -37
- package/dist/runtime/host/index.js +303 -151
- package/dist/runtime/host/location-runtime-owner.d.ts +2 -2
- package/dist/runtime/host/location-runtime-owner.js +1 -1
- package/dist/runtime/host/service-relocation-host-runtime.d.ts +195 -45
- package/dist/runtime/host/service-relocation-host-runtime.js +257 -144
- package/dist/runtime/host/spot-address-transport.d.ts +3 -0
- package/dist/runtime/host/spot-address-transport.js +73 -76
- package/dist/runtime/host/spot-runtime-options-factory.js +2 -0
- package/dist/runtime/host/user-spot-creation-coordinator.d.ts +3 -1
- package/dist/runtime/host/user-spot-creation-coordinator.js +49 -21
- package/dist/runtime/internal-observation.d.ts +1 -0
- package/dist/runtime/internal-observation.js +5 -0
- package/dist/runtime/locations/actor-location-claims.d.ts +1 -1
- package/dist/runtime/locations/actor-location-claims.js +15 -6
- package/dist/runtime/locations/auto-connect-loop.d.ts +0 -1
- package/dist/runtime/locations/auto-connect-loop.js +25 -19
- package/dist/runtime/locations/auto-connect-planner.js +2 -5
- package/dist/runtime/locations/auto-connect-reconciler.d.ts +1 -0
- package/dist/runtime/locations/auto-connect-reconciler.js +35 -23
- package/dist/runtime/locations/in-memory-authority-store.d.ts +1 -0
- package/dist/runtime/locations/in-memory-authority-store.js +15 -5
- package/dist/runtime/locations/in-memory-location-store.d.ts +0 -2
- package/dist/runtime/locations/in-memory-location-store.js +1 -38
- package/dist/runtime/locations/lifecycle.d.ts +1 -1
- package/dist/runtime/locations/lifecycle.js +2 -2
- package/dist/runtime/locations/location-store-repository.d.ts +0 -1
- package/dist/runtime/locations/location-store-repository.js +163 -246
- package/dist/runtime/locations/resolvers.d.ts +8 -1
- package/dist/runtime/locations/resolvers.js +16 -2
- package/dist/runtime/locations/runtime.d.ts +3 -3
- package/dist/runtime/locations/runtime.js +12 -16
- package/dist/runtime/messaging/creation-payload-codec.js +8 -7
- package/dist/runtime/messaging/framework-json-v1.d.ts +1 -1
- package/dist/runtime/messaging/framework-json-v1.js +6 -2
- package/dist/runtime/messaging/payload-codec.js +21 -35
- package/dist/runtime/messaging/request-deadline.d.ts +4 -2
- package/dist/runtime/messaging/request-deadline.js +40 -25
- package/dist/runtime/messaging/request-result.d.ts +14 -1
- package/dist/runtime/messaging/request-result.js +74 -13
- package/dist/runtime/protocol/service_wire_codec.generated.d.ts +4 -0
- package/dist/runtime/protocol/service_wire_codec.generated.js +17 -7
- package/dist/runtime/spots/index.d.ts +28 -7
- package/dist/runtime/spots/index.js +31 -6
- package/dist/runtime/spots/spot-activation-registry.d.ts +3 -2
- package/dist/runtime/spots/spot-activation-registry.js +13 -8
- package/dist/runtime/spots/spot-activation-state.d.ts +2 -0
- package/dist/runtime/spots/spot-activation-state.js +1 -0
- package/dist/runtime/spots/spot-actor-admission-coordinator.d.ts +9 -4
- package/dist/runtime/spots/spot-actor-admission-coordinator.js +33 -12
- package/dist/runtime/spots/spot-actor-ingress-admission.d.ts +40 -0
- package/dist/runtime/spots/spot-actor-ingress-admission.js +78 -0
- package/dist/runtime/spots/spot-actor-membership.js +3 -3
- package/dist/runtime/spots/spot-actor-packet-dispatch.d.ts +16 -43
- package/dist/runtime/spots/spot-actor-packet-dispatch.js +56 -113
- package/dist/runtime/spots/spot-actor-packet-drain.d.ts +1 -0
- package/dist/runtime/spots/spot-actor-packet-drain.js +12 -5
- package/dist/runtime/spots/spot-entry-activation.d.ts +4 -3
- package/dist/runtime/spots/spot-entry-activation.js +7 -12
- package/dist/runtime/spots/spot-handler-registry.d.ts +5 -1
- package/dist/runtime/spots/spot-handler-registry.js +31 -15
- package/dist/runtime/spots/spot-manager-public.js +3 -2
- package/dist/runtime/spots/spot-node-runtime-manager.d.ts +11 -6
- package/dist/runtime/spots/spot-node-runtime-manager.js +6 -1
- package/dist/runtime/spots/spot-outbound.d.ts +8 -2
- package/dist/runtime/spots/spot-outbound.js +5 -5
- package/dist/runtime/spots/spot-route-packet-dispatch.js +13 -8
- package/dist/runtime/spots/spot-routed-spot-packet-dispatch.d.ts +3 -3
- package/dist/runtime/spots/spot-routed-spot-packet-dispatch.js +9 -5
- package/dist/runtime/spots/spot-runtime-ports.d.ts +2 -2
- package/dist/runtime/spots/spot-serial-executor.d.ts +2 -1
- package/dist/runtime/spots/spot-serial-turn-executor.js +20 -26
- package/dist/runtime/spots/spot-subscription-dispatch.js +5 -2
- package/dist/runtime/spots/spot-timer.d.ts +1 -1
- package/dist/runtime/streams/actor-session-binding-registry.d.ts +11 -3
- package/dist/runtime/streams/actor-session-binding-registry.js +28 -0
- package/dist/runtime/streams/bound-actor-relay-sender.d.ts +2 -2
- package/dist/runtime/streams/bound-actor-relay-sender.js +3 -4
- package/dist/runtime/streams/bound-session-service.js +6 -7
- package/dist/runtime/streams/index.d.ts +3 -3
- package/dist/runtime/streams/index.js +22 -2
- package/dist/runtime/streams/managed-stream.js +2 -1
- package/dist/runtime/streams/session-calls.d.ts +1 -1
- package/dist/runtime/streams/session-calls.js +3 -9
- package/dist/runtime/streams/session-context.d.ts +2 -2
- package/dist/runtime/streams/session-context.js +2 -2
- package/dist/runtime/streams/stream-session-runtime.d.ts +1 -0
- package/dist/runtime/streams/stream-session-runtime.js +64 -33
- package/package.json +3 -3
- package/src/contracts/Actors/ZLinkActor.ts +6 -0
- package/src/contracts/Actors/ZLinkSessionBindingIdentity.ts +7 -0
- package/src/contracts/Actors/index.ts +1 -0
- package/src/contracts/Common/CoreTypes.ts +1 -0
- package/src/contracts/Common/HandlerMessageType.ts +50 -0
- package/src/contracts/Common/ZLinkEncodedPayload.ts +13 -25
- package/src/contracts/Common/ZLinkMessage.ts +11 -7
- package/src/contracts/Common/encoded-payload-storage.ts +4 -16
- package/src/contracts/Common/index.ts +1 -1
- package/src/contracts/Common/payload-slab.ts +29 -0
- package/src/contracts/Configuration/RegistrationBuilders.ts +29 -15
- package/src/contracts/Configuration/RegistrationTypes.ts +19 -0
- package/src/contracts/Handlers/Contexts.ts +1 -0
- package/src/contracts/Locations/Authority.ts +7 -1
- package/src/internal.ts +17 -0
- package/src/nest-integration.ts +1 -0
- package/src/runtime/actors/actor-client.ts +257 -163
- package/src/runtime/actors/actor-context.ts +26 -14
- package/src/runtime/actors/actor-execution-context.ts +2 -2
- package/src/runtime/actors/actor-handoff.ts +86 -51
- package/src/runtime/actors/actor-join-deferred-scope.ts +6 -6
- package/src/runtime/actors/actor-local-native-join.ts +38 -17
- package/src/runtime/actors/actor-mailbox.ts +1 -1
- package/src/runtime/actors/actor-remote-joiner.ts +8 -4
- package/src/runtime/actors/actor-routed-join-transport.ts +13 -5
- package/src/runtime/actors/actor-routed-json-request.ts +3 -0
- package/src/runtime/actors/actor-runtime-contracts.ts +4 -2
- package/src/runtime/actors/actor-runtime-state.ts +1 -1
- package/src/runtime/actors/spot-actor-dispatch.ts +70 -68
- package/src/runtime/admission.ts +42 -15
- package/src/runtime/application-jobs/application-ingress-record-owner.ts +4 -0
- package/src/runtime/backend/contracts/index.ts +77 -10
- package/src/runtime/backend/mesh-completion-table.ts +106 -15
- package/src/runtime/backend/mesh-dispatch-pump.ts +294 -146
- package/src/runtime/backend/node/node-backend-adapter-support.ts +42 -32
- package/src/runtime/backend/node/node-dealer-channel-client-transport.ts +91 -34
- package/src/runtime/backend/node/node-event-loop-poller.ts +14 -5
- package/src/runtime/backend/node/node-mesh-backend-adapter.ts +5 -1
- package/src/runtime/backend/node/node-raw-binding-port.ts +180 -69
- package/src/runtime/backend/node/node-raw-mesh-backend.ts +386 -157
- package/src/runtime/backend/node/node-socket-backend-adapter.ts +56 -11
- package/src/runtime/backend/raw-binding-port.ts +13 -5
- package/src/runtime/channels/channel-clients.ts +26 -11
- package/src/runtime/channels/channel-dispatch-pipeline.ts +77 -65
- package/src/runtime/channels/channel-dispatch-services.ts +7 -12
- package/src/runtime/channels/channel-dispatchers.ts +93 -39
- package/src/runtime/channels/channel-envelope.ts +680 -144
- package/src/runtime/channels/channel-multipart.ts +17 -13
- package/src/runtime/channels/channel-outbound-operations.ts +204 -178
- package/src/runtime/channels/channel-receive-loops.ts +160 -107
- package/src/runtime/channels/channel-runtime-lifecycle.ts +64 -59
- package/src/runtime/channels/channel-runtime-manager.ts +74 -27
- package/src/runtime/channels/channel-socket-registry.ts +20 -5
- package/src/runtime/channels/channel-transports.ts +414 -287
- package/src/runtime/channels/dispatch-error-reporter.ts +4 -9
- package/src/runtime/channels/local-spot-route-transport.ts +27 -29
- package/src/runtime/channels/router-socket-spot-route-transport.ts +63 -32
- package/src/runtime/channels/source-spot-router.ts +75 -38
- package/src/runtime/channels/spot-node-route-transport.ts +67 -37
- package/src/runtime/channels/spot-route-bridge-transport.ts +62 -30
- package/src/runtime/channels/spot-route-dispatch-strategy.ts +105 -34
- package/src/runtime/diagnostics/dispatch-error-details.ts +10 -2
- package/src/runtime/diagnostics/message-flow-bootstrap.ts +6 -0
- package/src/runtime/diagnostics/message-flow-delivery.ts +171 -0
- package/src/runtime/diagnostics/message-flow-record.ts +295 -0
- package/src/runtime/diagnostics/message-flow-worker.ts +146 -0
- package/src/runtime/diagnostics/message-flow.ts +49 -362
- package/src/runtime/diagnostics/runtime-metrics.ts +10 -4
- package/src/runtime/execution/index.ts +6 -0
- package/src/runtime/execution/serial-execution-queue.ts +94 -96
- package/src/runtime/foundation/durable-service-request.ts +212 -89
- package/src/runtime/foundation/operation-registry.ts +287 -38
- package/src/runtime/foundation/raw-service-mesh-runtime.ts +617 -292
- package/src/runtime/foundation/request-runtime.ts +227 -0
- package/src/runtime/foundation/service-discovery-registry.ts +7 -0
- package/src/runtime/foundation/service-liveness-registry.ts +1 -1
- package/src/runtime/foundation/service-mailbox.ts +7 -2
- package/src/runtime/foundation/service-relocation-object-owner.ts +21 -6
- package/src/runtime/foundation/service-runtime-contracts.ts +12 -2
- package/src/runtime/foundation/service-stateful-registry.ts +52 -19
- package/src/runtime/foundation/service-stateful-runtime.ts +365 -198
- package/src/runtime/foundation/service-stateful-wire-codec.ts +18 -0
- package/src/runtime/foundation/service-topology-registry.ts +21 -3
- package/src/runtime/foundation/service-wire-constants.generated.ts +10 -0
- package/src/runtime/foundation/service-wire-m6a-codec.ts +69 -17
- package/src/runtime/host/actor-packet-relay.ts +160 -156
- package/src/runtime/host/actor-placement-coordinator.ts +1 -1
- package/src/runtime/host/actor-runtime-options-factory.ts +7 -2
- package/src/runtime/host/actor-transfer-runtime.ts +3 -3
- package/src/runtime/host/application-job-queue.ts +56 -27
- package/src/runtime/host/bound-session-relay.ts +0 -1
- package/src/runtime/host/channel-runtime-options-factory.ts +3 -0
- package/src/runtime/host/entry-actor-runtime.ts +14 -6
- package/src/runtime/host/index.ts +388 -113
- package/src/runtime/host/location-runtime-owner.ts +3 -3
- package/src/runtime/host/service-relocation-host-runtime.ts +380 -252
- package/src/runtime/host/spot-address-transport.ts +110 -95
- package/src/runtime/host/spot-runtime-options-factory.ts +3 -0
- package/src/runtime/host/user-spot-creation-coordinator.ts +69 -22
- package/src/runtime/internal-observation.ts +2 -0
- package/src/runtime/locations/actor-location-claims.ts +42 -16
- package/src/runtime/locations/auto-connect-loop.ts +24 -16
- package/src/runtime/locations/auto-connect-planner.ts +2 -5
- package/src/runtime/locations/auto-connect-reconciler.ts +37 -24
- package/src/runtime/locations/in-memory-authority-store.ts +27 -7
- package/src/runtime/locations/in-memory-location-store.ts +1 -74
- package/src/runtime/locations/lifecycle.ts +4 -2
- package/src/runtime/locations/location-store-repository.ts +228 -308
- package/src/runtime/locations/resolvers.ts +20 -8
- package/src/runtime/locations/runtime.ts +16 -28
- package/src/runtime/messaging/creation-payload-codec.ts +12 -10
- package/src/runtime/messaging/framework-json-v1.ts +10 -1
- package/src/runtime/messaging/payload-codec.ts +50 -75
- package/src/runtime/messaging/request-deadline.ts +47 -39
- package/src/runtime/messaging/request-result.ts +88 -17
- package/src/runtime/protocol/service_wire_codec.generated.ts +18 -8
- package/src/runtime/protocol/service_wire_pilot_codec.generated.ts +1 -1
- package/src/runtime/spots/index.ts +57 -10
- package/src/runtime/spots/spot-activation-registry.ts +12 -8
- package/src/runtime/spots/spot-activation-state.ts +2 -0
- package/src/runtime/spots/spot-actor-admission-coordinator.ts +62 -37
- package/src/runtime/spots/spot-actor-ingress-admission.ts +157 -0
- package/src/runtime/spots/spot-actor-membership.ts +8 -5
- package/src/runtime/spots/spot-actor-packet-dispatch.ts +122 -206
- package/src/runtime/spots/spot-actor-packet-drain.ts +21 -6
- package/src/runtime/spots/spot-entry-activation.ts +25 -35
- package/src/runtime/spots/spot-handler-registry.ts +72 -15
- package/src/runtime/spots/spot-manager-public.ts +4 -2
- package/src/runtime/spots/spot-node-runtime-manager.ts +16 -7
- package/src/runtime/spots/spot-outbound.ts +26 -10
- package/src/runtime/spots/spot-route-packet-dispatch.ts +18 -8
- package/src/runtime/spots/spot-routed-spot-packet-dispatch.ts +14 -8
- package/src/runtime/spots/spot-runtime-ports.ts +5 -2
- package/src/runtime/spots/spot-serial-executor.ts +1 -1
- package/src/runtime/spots/spot-serial-turn-executor.ts +25 -40
- package/src/runtime/spots/spot-subscription-dispatch.ts +9 -2
- package/src/runtime/spots/spot-timer.ts +1 -1
- package/src/runtime/streams/actor-session-binding-registry.ts +46 -3
- package/src/runtime/streams/bound-actor-relay-sender.ts +16 -5
- package/src/runtime/streams/bound-session-service.ts +10 -7
- package/src/runtime/streams/index.ts +30 -4
- package/src/runtime/streams/managed-stream.ts +2 -1
- package/src/runtime/streams/session-calls.ts +9 -14
- package/src/runtime/streams/session-context.ts +6 -11
- package/src/runtime/streams/stream-session-runtime.ts +79 -40
- package/dist/runtime/spots/spot-lifecycle-metrics.d.ts +0 -8
- package/dist/runtime/spots/spot-lifecycle-metrics.js +0 -17
- package/src/runtime/spots/spot-lifecycle-metrics.ts +0 -16
|
@@ -51,6 +51,7 @@ export declare class ApplicationJobQueuePermit implements ApplicationJobPermitPo
|
|
|
51
51
|
markApplicationQueued(): void;
|
|
52
52
|
releaseBeforeHandler(): void;
|
|
53
53
|
releaseAfterInternalProcessing(): void;
|
|
54
|
+
releaseUnqueued(): void;
|
|
54
55
|
takeReleaseState(): 'reserved' | 'queued' | undefined;
|
|
55
56
|
}
|
|
56
57
|
/**
|
|
@@ -68,6 +69,7 @@ declare class ApplicationJobReceiveRotation implements ApplicationJobReceiveRota
|
|
|
68
69
|
private consumed;
|
|
69
70
|
constructor(owner: ApplicationJobQueue, capacity: number, origin: ApplicationJobOrigin);
|
|
70
71
|
reserve(): void;
|
|
72
|
+
acquire(signal: AbortSignal): Promise<void>;
|
|
71
73
|
take(): ApplicationJobQueuePermit | undefined;
|
|
72
74
|
releaseUnused(): void;
|
|
73
75
|
returnIdle(permit: ApplicationJobQueuePermit): void;
|
|
@@ -105,13 +107,13 @@ export declare class ApplicationJobQueue implements ApplicationJobQueuePort {
|
|
|
105
107
|
private readonly receiveFlowController;
|
|
106
108
|
constructor(configuration: ApplicationJobQueueConfiguration, nowMs?: () => number, handlerStartGate?: (() => boolean) | undefined, loggerFailureReporter?: ((error: unknown) => void) | undefined);
|
|
107
109
|
shouldHoldPermitBeforeHandler(): boolean;
|
|
108
|
-
createReceiveRotation(capacity: number, origin: ApplicationJobOrigin):
|
|
109
|
-
|
|
110
|
-
reserveReceiveRotation(count: number): void;
|
|
110
|
+
createReceiveRotation(capacity: number, origin: ApplicationJobOrigin): ApplicationJobReceiveRotation;
|
|
111
|
+
tryReserveCount(requested: number): number | undefined;
|
|
111
112
|
registerReceiveFlowTarget(identity: object, applyState: (state: ApplicationJobQueuePressureState) => void, failureSink?: (error: unknown) => void): boolean;
|
|
112
113
|
unregisterReceiveFlowTarget(identity: object): void;
|
|
113
114
|
acquire(signal: AbortSignal | undefined, origin: ApplicationJobOrigin): Promise<ApplicationJobQueuePermit>;
|
|
114
115
|
acquireOrResume(resume: (permit: ApplicationJobQueuePermit) => void, reject: (reason: unknown) => void, signal: AbortSignal | undefined, origin: ApplicationJobOrigin): ApplicationJobQueuePermit | undefined;
|
|
116
|
+
acquireCountOrResume(resume: (count: number) => void, reject: (reason: unknown) => void, signal: AbortSignal | undefined, origin: ApplicationJobOrigin, requested: number): number | undefined;
|
|
115
117
|
snapshot(): ApplicationJobQueueSnapshot;
|
|
116
118
|
resetMetrics(): void;
|
|
117
119
|
pressureState(): ApplicationJobQueuePressureState;
|
|
@@ -125,13 +127,13 @@ export declare class ApplicationJobQueue implements ApplicationJobQueuePort {
|
|
|
125
127
|
private limit;
|
|
126
128
|
private permitsInUse;
|
|
127
129
|
private reserveSupply;
|
|
128
|
-
private
|
|
130
|
+
private reserveCount;
|
|
129
131
|
private drainWaiters;
|
|
130
132
|
private cancel;
|
|
131
133
|
private recordCompletedWait;
|
|
132
134
|
private updateLocalWaiters;
|
|
133
135
|
private logLocalBacklog;
|
|
134
|
-
|
|
136
|
+
evaluatePressure(): void;
|
|
135
137
|
private pauseDurationAt;
|
|
136
138
|
private cumulativePauseDurationAt;
|
|
137
139
|
}
|
|
@@ -4,13 +4,14 @@ exports.ApplicationJobQueue = exports.ApplicationJobQueuePermit = void 0;
|
|
|
4
4
|
exports.resolveApplicationJobQueueConfiguration = resolveApplicationJobQueueConfiguration;
|
|
5
5
|
exports.nodeEffectiveProcessorCount = nodeEffectiveProcessorCount;
|
|
6
6
|
const api_logs_1 = require("@opentelemetry/api-logs");
|
|
7
|
-
const
|
|
7
|
+
const message_flow_record_1 = require("../diagnostics/message-flow-record");
|
|
8
8
|
const runtime_metrics_1 = require("../diagnostics/runtime-metrics");
|
|
9
9
|
const Dispatch_1 = require("../../contracts/Dispatch");
|
|
10
10
|
const Registration_1 = require("../../contracts/Configuration/Registration");
|
|
11
11
|
const node_fs_1 = require("node:fs");
|
|
12
12
|
const node_os_1 = require("node:os");
|
|
13
13
|
const receive_flow_controller_1 = require("../application-jobs/receive-flow-controller");
|
|
14
|
+
const telemetryLogger = api_logs_1.logs.getLogger(message_flow_record_1.TELEMETRY_INSTRUMENTATION_NAME);
|
|
14
15
|
const CGROUP_V2_CPU_MAX = '/sys/fs/cgroup/cpu.max';
|
|
15
16
|
const CGROUP_V1_CPU_QUOTA = '/sys/fs/cgroup/cpu/cpu.cfs_quota_us';
|
|
16
17
|
const CGROUP_V1_CPU_PERIOD = '/sys/fs/cgroup/cpu/cpu.cfs_period_us';
|
|
@@ -98,6 +99,10 @@ class ApplicationJobQueuePermit {
|
|
|
98
99
|
releaseAfterInternalProcessing() {
|
|
99
100
|
this.owner.releasePermit(this);
|
|
100
101
|
}
|
|
102
|
+
releaseUnqueued() {
|
|
103
|
+
if (this.state === 'reserved')
|
|
104
|
+
this.owner.releasePermit(this);
|
|
105
|
+
}
|
|
101
106
|
takeReleaseState() {
|
|
102
107
|
if (this.state === 'released' || this.state === 'idle')
|
|
103
108
|
return undefined;
|
|
@@ -127,11 +132,15 @@ class ApplicationJobReceiveRotation {
|
|
|
127
132
|
}
|
|
128
133
|
reserve() {
|
|
129
134
|
this.releaseUnused();
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
this.
|
|
134
|
-
this.
|
|
135
|
+
this.granted = this.owner.tryReserveCount(this.capacity) ?? 0;
|
|
136
|
+
}
|
|
137
|
+
async acquire(signal) {
|
|
138
|
+
this.releaseUnused();
|
|
139
|
+
this.granted = await new Promise((resolve, reject) => {
|
|
140
|
+
const count = this.owner.acquireCountOrResume(resolve, reject, signal, this.origin, this.capacity);
|
|
141
|
+
if (count !== undefined)
|
|
142
|
+
resolve(count);
|
|
143
|
+
});
|
|
135
144
|
}
|
|
136
145
|
take() {
|
|
137
146
|
if (this.consumed === this.granted)
|
|
@@ -201,13 +210,10 @@ class ApplicationJobQueue {
|
|
|
201
210
|
throw new RangeError('Receive capacity must be positive.');
|
|
202
211
|
return new ApplicationJobReceiveRotation(this, capacity, origin);
|
|
203
212
|
}
|
|
204
|
-
|
|
205
|
-
if (this.waiters.length !== 0)
|
|
206
|
-
return
|
|
207
|
-
return
|
|
208
|
-
}
|
|
209
|
-
reserveReceiveRotation(count) {
|
|
210
|
-
this.reserveSupply(count);
|
|
213
|
+
tryReserveCount(requested) {
|
|
214
|
+
if (this.waiters.length !== 0 || this.permitsInUse() === this.limitCount)
|
|
215
|
+
return undefined;
|
|
216
|
+
return this.reserveCount(requested);
|
|
211
217
|
}
|
|
212
218
|
registerReceiveFlowTarget(identity, applyState, failureSink) {
|
|
213
219
|
this.unregisterReceiveFlowTarget(identity);
|
|
@@ -257,16 +263,21 @@ class ApplicationJobQueue {
|
|
|
257
263
|
});
|
|
258
264
|
}
|
|
259
265
|
acquireOrResume(resume, reject, signal, origin) {
|
|
266
|
+
const count = this.acquireCountOrResume(() => resume(new ApplicationJobQueuePermit(this, origin)), reject, signal, origin, 1);
|
|
267
|
+
return count === undefined ? undefined : new ApplicationJobQueuePermit(this, origin);
|
|
268
|
+
}
|
|
269
|
+
acquireCountOrResume(resume, reject, signal, origin, requested) {
|
|
260
270
|
if (signal?.aborted === true) {
|
|
261
271
|
reject(abortReason(signal));
|
|
262
272
|
return undefined;
|
|
263
273
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
274
|
+
const count = this.tryReserveCount(requested);
|
|
275
|
+
if (count !== undefined)
|
|
276
|
+
return count;
|
|
267
277
|
new Promise((resolve, reject) => {
|
|
268
278
|
const waiter = {
|
|
269
279
|
origin,
|
|
280
|
+
requested,
|
|
270
281
|
resolve,
|
|
271
282
|
reject,
|
|
272
283
|
signal,
|
|
@@ -377,9 +388,10 @@ class ApplicationJobQueue {
|
|
|
377
388
|
if (evaluatePressure)
|
|
378
389
|
this.evaluatePressure();
|
|
379
390
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
391
|
+
reserveCount(requested, evaluatePressure = true) {
|
|
392
|
+
const count = Math.min(requested, this.limitCount - this.permitsInUse());
|
|
393
|
+
this.reserveSupply(count, evaluatePressure);
|
|
394
|
+
return count;
|
|
383
395
|
}
|
|
384
396
|
drainWaiters() {
|
|
385
397
|
while (this.waiters.length > 0 && this.permitsInUse() < this.limitCount) {
|
|
@@ -389,7 +401,7 @@ class ApplicationJobQueue {
|
|
|
389
401
|
waiter.active = false;
|
|
390
402
|
waiter.signal?.removeEventListener('abort', waiter.abort);
|
|
391
403
|
this.recordCompletedWait(waiter);
|
|
392
|
-
waiter.resolve(this.
|
|
404
|
+
waiter.resolve(this.reserveCount(waiter.requested, false));
|
|
393
405
|
}
|
|
394
406
|
}
|
|
395
407
|
cancel(waiter) {
|
|
@@ -425,7 +437,7 @@ class ApplicationJobQueue {
|
|
|
425
437
|
}
|
|
426
438
|
logLocalBacklog(localWaiters) {
|
|
427
439
|
try {
|
|
428
|
-
|
|
440
|
+
telemetryLogger.emit({
|
|
429
441
|
eventName: 'zlink.runtime.host.local_job_backlog_exceeded',
|
|
430
442
|
timestamp: new Date(),
|
|
431
443
|
severityNumber: api_logs_1.SeverityNumber.WARN,
|
|
@@ -15,7 +15,6 @@ class ZLinkBoundSessionRelay {
|
|
|
15
15
|
actorManager: options.actorManager,
|
|
16
16
|
streamBindingRuntime: options.streamBindingRuntime,
|
|
17
17
|
meshRouters: options.meshRouters,
|
|
18
|
-
spotManager: options.spotManager,
|
|
19
18
|
spotNodeRuntime: options.spotNodeRuntime,
|
|
20
19
|
detachedTaskRunner: options.detachedTaskRunner,
|
|
21
20
|
errorSink: options.errorSink,
|
|
@@ -2,11 +2,13 @@ import type { ZLinkChannelRuntimeManagerOptions } from '../channels';
|
|
|
2
2
|
import type { ZLinkMonitoringBackendAdapter } from '../backend';
|
|
3
3
|
import type { DefaultZLinkSpotManager } from '../spots';
|
|
4
4
|
import type { ZLinkMessageFlowModeCell } from '../diagnostics';
|
|
5
|
+
import type { ZLinkTelemetryLease } from '../diagnostics/message-flow-delivery';
|
|
5
6
|
import type { ZLinkBoundSessionRelay } from './bound-session-relay';
|
|
6
7
|
import type { ApplicationJobQueue } from './application-job-queue';
|
|
7
8
|
export interface ZLinkChannelRuntimeOptionsFactoryOptions {
|
|
8
9
|
readonly monitoringAdapter: ZLinkMonitoringBackendAdapter;
|
|
9
10
|
readonly messageFlowModeCell: ZLinkMessageFlowModeCell;
|
|
11
|
+
readonly telemetryLease?: ZLinkTelemetryLease;
|
|
10
12
|
readonly boundSessionRelay: ZLinkBoundSessionRelay;
|
|
11
13
|
readonly spotManager: () => DefaultZLinkSpotManager | undefined;
|
|
12
14
|
readonly oneWayFailureSink: (error: unknown) => void;
|
|
@@ -12,6 +12,7 @@ class ZLinkChannelRuntimeOptionsFactory {
|
|
|
12
12
|
return {
|
|
13
13
|
monitoringAdapter: this.options.monitoringAdapter,
|
|
14
14
|
messageFlowModeCell: this.options.messageFlowModeCell,
|
|
15
|
+
telemetryLease: this.options.telemetryLease,
|
|
15
16
|
applicationJobQueue: this.options.applicationJobQueue,
|
|
16
17
|
oneWayFailureSink: this.options.oneWayFailureSink,
|
|
17
18
|
internalRouteSendHandlers: this.internalRouteSendHandlers(),
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { ApplicationJobOrigin } from '../application-jobs/contracts';
|
|
2
|
+
import type { ZLinkActorRequestTerminal } from '../spots/spot-actor-packet-dispatch';
|
|
3
|
+
import type { ZLinkMessageFollowOrigin } from '../foundation/service-runtime-contracts';
|
|
1
4
|
import type { ActorRef, ZLinkActor } from '../../contracts';
|
|
2
5
|
import type { Message } from '../../contracts/Common/Message';
|
|
3
6
|
import type { ZLinkBackendSpotNode } from '../backend';
|
|
@@ -23,9 +26,9 @@ export declare class ZLinkEntryActorRuntimeService implements ZLinkEntryActorRun
|
|
|
23
26
|
releaseMembers(meshName: string): Promise<void>;
|
|
24
27
|
commitActorTransaction(actor: ZLinkActor, onJoined: () => Promise<void>): Promise<void>;
|
|
25
28
|
destroyActor(node: ZLinkBackendSpotNode, entryNodeRid: ActorRef['nodeRid'], actor: ZLinkActor, signal?: AbortSignal): Promise<void>;
|
|
26
|
-
routePacket(actorId: string, parts: readonly Message[], returnResponse?: boolean, remoteBoundSessionTarget?: ZLinkRemoteBoundSessionTarget, fallbackActorRef?: ActorRef):
|
|
29
|
+
routePacket(actorId: string, parts: readonly Message[], returnResponse?: boolean, remoteBoundSessionTarget?: ZLinkRemoteBoundSessionTarget, fallbackActorRef?: ActorRef, origin?: ApplicationJobOrigin, requestTerminal?: ZLinkActorRequestTerminal, messageFollowOrigin?: ZLinkMessageFollowOrigin): {
|
|
27
30
|
readonly handled: boolean;
|
|
28
31
|
readonly response?: unknown;
|
|
29
|
-
}
|
|
32
|
+
};
|
|
30
33
|
private requireActorManager;
|
|
31
34
|
}
|
|
@@ -61,7 +61,7 @@ class ZLinkEntryActorRuntimeService {
|
|
|
61
61
|
async destroyActor(node, entryNodeRid, actor, signal) {
|
|
62
62
|
await this.requireActorManager().destroyActor(node, entryNodeRid, actor, signal);
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
routePacket(actorId, parts, returnResponse, remoteBoundSessionTarget, fallbackActorRef, origin = 'remote', requestTerminal, messageFollowOrigin) {
|
|
65
65
|
const spotManager = this.options.spotManager();
|
|
66
66
|
const spotId = this.options.actorManager()?.getState(actorId)?.spotId;
|
|
67
67
|
if (spotId === undefined || spotManager === undefined) {
|
|
@@ -69,7 +69,7 @@ class ZLinkEntryActorRuntimeService {
|
|
|
69
69
|
}
|
|
70
70
|
return {
|
|
71
71
|
handled: true,
|
|
72
|
-
response:
|
|
72
|
+
response: spotManager.dispatchRoutedActorPacket(origin, spotId, actorId, parts, returnResponse, remoteBoundSessionTarget, fallbackActorRef, requestTerminal, messageFollowOrigin)
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
requireActorManager() {
|
|
@@ -1,16 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RequestRuntime } from '../foundation/request-runtime';
|
|
2
|
+
import { inspectRuntime } from '../internal-observation';
|
|
3
|
+
import type { ApplicationJobOrigin } from '../application-jobs/contracts';
|
|
4
|
+
import { type ZLinkClientServerRuntime, type ZLinkFanoutRuntime, type ZLinkFrameworkLifecycleOptions, type ZLinkFrameworkRelocationOptions, type ZLinkFrameworkRelocationResult, type ZLinkFrameworkRuntime, type ZLinkFrameworkRuntimeStatus, type ZLinkFrameworkTerminationResult, type ZLinkListenerKind, type ZLinkListenerStatus, type ZLinkMeshNodeDescriptor, type ZLinkMessageFlowControl, type ZLinkMessageFlowLogMode, type ZLinkObservedStatus, type ZLinkRouteMeshRuntime, ZLinkFrameworkRelocationReason, ZLinkFrameworkRuntimeState } from '../../contracts';
|
|
2
5
|
import type { ZLinkProviderResolver } from '../../contracts/Common/ZLinkProviderResolver';
|
|
3
6
|
import { type ZLinkLocationRuntimeQuery } from '../../contracts/Locations';
|
|
4
7
|
import { type DefaultZLinkActorManager, type ZLinkActorManagerOptions, DefaultZLinkActorClient } from '../actors';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
8
|
+
import { ZLinkRuntimeAdmissionGate, type ZLinkMeshDispatchAdmission } from '../admission';
|
|
9
|
+
import { type ZLinkBackendAdapterFactory, type ZLinkBackendContext, type ZLinkBackendMeshNode } from '../backend';
|
|
10
|
+
import { type ZLinkBackendMessageLike as MessageLike } from '../backend/runtime-values';
|
|
11
|
+
import { DefaultZLinkChannelRuntimeOptions, ZLinkChannelRuntimeManager, ZLinkDispatchErrorReporter, ZLinkRuntimeRouteTransport, type ZLinkDispatchErrorSink } from '../channels';
|
|
7
12
|
import type { ZLinkFrameworkRegistration } from '../configuration';
|
|
8
|
-
import { type ZLinkRuntimeEventPublisher } from '../diagnostics';
|
|
13
|
+
import { type ZLinkRuntimeEventPublisher, ZLinkRuntimeMetrics, type ZLinkRuntimeMetricMeshSnapshot } from '../diagnostics';
|
|
9
14
|
import { ZLinkFrameworkExecutionState } from '../execution';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
15
|
+
import { ZLinkListenerRecords } from '../foundation/listener-records';
|
|
16
|
+
import { type ReadyRecord, type ReceiveRecord } from '../foundation/service-runtime-contracts';
|
|
17
|
+
import type { ServiceMessageFollowRecord } from '../foundation/service-stateful-wire-codec';
|
|
18
|
+
import { type ZLinkLocationRuntime, type ZLinkStoreLocationResolvers } from '../locations';
|
|
19
|
+
import { ZLinkSubmitStatus } from '../messaging/submission-result';
|
|
20
|
+
import { DefaultZLinkSpotManager, ZLinkRuntimeSpotPublisherTransport, ZLinkSpotNodeRuntimeManager, type ZLinkDetachedTaskRunner, type ZLinkSpotManagerOptions } from '../spots';
|
|
21
|
+
import type { ZLinkSpotRouteResolver } from '../spots/spot-routing-internal';
|
|
12
22
|
import { DefaultZLinkBoundSessionFactory, ZLinkStreamBindingRuntime } from '../streams';
|
|
23
|
+
import { ZLinkActorPlacementCoordinator } from './actor-placement-coordinator';
|
|
24
|
+
import { ApplicationJobQueue } from './application-job-queue';
|
|
25
|
+
import { ZLinkBoundSessionRelay } from './bound-session-relay';
|
|
26
|
+
import { ZLinkEntryActorRuntimeService } from './entry-actor-runtime';
|
|
27
|
+
import { ZLinkLocationRuntimeOwner } from './location-runtime-owner';
|
|
28
|
+
import { ZLinkRouteMeshRuntimeCoordinator } from './route-mesh-runtime';
|
|
13
29
|
import { DefaultZLinkRouteMeshRuntimeOptions } from './route-mesh-runtime-options';
|
|
30
|
+
import { ZLinkHostServiceRelocationRuntime } from './service-relocation-host-runtime';
|
|
14
31
|
import { ZLinkHostSpotAddressTransport } from './spot-address-transport';
|
|
15
32
|
export interface ZLinkFrameworkRuntimeLifecycle {
|
|
16
33
|
readonly isStarted: boolean;
|
|
@@ -26,10 +43,23 @@ export interface ZLinkFrameworkRuntimeHostOptions {
|
|
|
26
43
|
}
|
|
27
44
|
export declare class ZLinkFrameworkRuntimeHost implements ZLinkFrameworkRuntimeLifecycle, ZLinkFrameworkRuntime, ZLinkMessageFlowControl {
|
|
28
45
|
readonly options: ZLinkFrameworkRuntimeHostOptions;
|
|
46
|
+
[inspectRuntime](): Readonly<{
|
|
47
|
+
ownerLeaseUsable: boolean | undefined;
|
|
48
|
+
ownerId: string | undefined;
|
|
49
|
+
hasOwnerToken: boolean;
|
|
50
|
+
ownerAdmissionOpen: boolean;
|
|
51
|
+
channelRuntimeStarted: boolean;
|
|
52
|
+
fanoutStoreIsLocationStore: boolean;
|
|
53
|
+
fanoutStoreMethods: Readonly<{
|
|
54
|
+
update: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
55
|
+
remove: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
56
|
+
list: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
57
|
+
}>;
|
|
58
|
+
}>;
|
|
29
59
|
private readonly backendAdapterFactory;
|
|
30
60
|
private readonly lifecycleSink?;
|
|
31
|
-
|
|
32
|
-
|
|
61
|
+
executionState?: ZLinkFrameworkExecutionState;
|
|
62
|
+
runtimeState: ZLinkFrameworkRuntimeState;
|
|
33
63
|
private runtimeStatus?;
|
|
34
64
|
private readonly runtimeObservationSource;
|
|
35
65
|
private runtimeDeadline?;
|
|
@@ -44,21 +74,21 @@ export declare class ZLinkFrameworkRuntimeHost implements ZLinkFrameworkRuntimeL
|
|
|
44
74
|
private shutdownOperationStartedAt?;
|
|
45
75
|
private relocationTargetApplicationVersion?;
|
|
46
76
|
private readonly runtimeObservers;
|
|
47
|
-
|
|
48
|
-
|
|
77
|
+
channelRuntime?: ZLinkChannelRuntimeManager;
|
|
78
|
+
spotNodeRuntime?: ZLinkSpotNodeRuntimeManager;
|
|
49
79
|
private streamRuntime?;
|
|
50
80
|
private statefulAuthorityRoutes?;
|
|
51
|
-
|
|
81
|
+
readonly locationOwner: ZLinkLocationRuntimeOwner;
|
|
52
82
|
private readonly meshRouters;
|
|
53
|
-
|
|
83
|
+
readonly boundSessionRelay: ZLinkBoundSessionRelay;
|
|
54
84
|
private readonly actorHandoff;
|
|
55
85
|
private readonly actorTransferRegistry;
|
|
56
86
|
private readonly actorTransferRuntime;
|
|
57
87
|
private readonly actorTransferAuthorityRuntime;
|
|
58
|
-
|
|
59
|
-
|
|
88
|
+
readonly serviceRelocation: ZLinkHostServiceRelocationRuntime;
|
|
89
|
+
readonly entryActorRuntime: ZLinkEntryActorRuntimeService;
|
|
60
90
|
private actorManager?;
|
|
61
|
-
|
|
91
|
+
actorPlacement?: ZLinkActorPlacementCoordinator;
|
|
62
92
|
private spotManager?;
|
|
63
93
|
private userSpotCoordinator?;
|
|
64
94
|
private ownerLeaseRecoveryRuntime?;
|
|
@@ -67,21 +97,23 @@ export declare class ZLinkFrameworkRuntimeHost implements ZLinkFrameworkRuntimeL
|
|
|
67
97
|
private readonly destroyedActorRefs;
|
|
68
98
|
private readonly runtimeEventPublisher;
|
|
69
99
|
private readonly metrics;
|
|
70
|
-
|
|
100
|
+
readonly applicationJobQueue: ApplicationJobQueue;
|
|
71
101
|
private readonly capacityStatus;
|
|
72
102
|
private readonly metricRegistrations;
|
|
73
|
-
|
|
103
|
+
readonly admission: ZLinkRuntimeAdmissionGate;
|
|
74
104
|
private readonly activationAdmission;
|
|
75
105
|
private cachedLocationSpotRouteResolver?;
|
|
76
106
|
private actorClientLocationResolver?;
|
|
77
107
|
private readonly messageFlowModeCell;
|
|
78
|
-
private
|
|
79
|
-
private
|
|
108
|
+
private telemetryLease;
|
|
109
|
+
private dispatchErrorReporters;
|
|
110
|
+
readonly runtimeOrPreStartErrorSink: ZLinkDispatchErrorSink;
|
|
80
111
|
private cachedDiagnosticsContext?;
|
|
81
112
|
private readonly preStartErrorSink;
|
|
82
113
|
readonly channelTransport: () => ZLinkChannelRuntimeManager | undefined;
|
|
83
114
|
readonly channelRuntimeOptions: DefaultZLinkChannelRuntimeOptions;
|
|
84
115
|
readonly routeMeshRuntimeOptions: DefaultZLinkRouteMeshRuntimeOptions;
|
|
116
|
+
private readonly requests;
|
|
85
117
|
readonly routeTransport: ZLinkRuntimeRouteTransport;
|
|
86
118
|
readonly spotAddressTransport: ZLinkHostSpotAddressTransport;
|
|
87
119
|
readonly spotPublisherTransport: ZLinkRuntimeSpotPublisherTransport;
|
|
@@ -92,7 +124,7 @@ export declare class ZLinkFrameworkRuntimeHost implements ZLinkFrameworkRuntimeL
|
|
|
92
124
|
readonly clientServerRuntime: ZLinkClientServerRuntime;
|
|
93
125
|
readonly fanoutRuntime: ZLinkFanoutRuntime;
|
|
94
126
|
private readonly relocationStore?;
|
|
95
|
-
|
|
127
|
+
readonly routeMeshCoordinator: ZLinkRouteMeshRuntimeCoordinator;
|
|
96
128
|
constructor(options: ZLinkFrameworkRuntimeHostOptions, internalOptions?: unknown);
|
|
97
129
|
get isStarted(): boolean;
|
|
98
130
|
get status(): ZLinkFrameworkRuntimeStatus;
|
|
@@ -132,17 +164,17 @@ export declare class ZLinkFrameworkRuntimeHost implements ZLinkFrameworkRuntimeL
|
|
|
132
164
|
start(): Promise<void>;
|
|
133
165
|
private startCore;
|
|
134
166
|
stop(): Promise<void>;
|
|
135
|
-
|
|
167
|
+
runtimeMetricMeshSnapshots(): readonly ZLinkRuntimeMetricMeshSnapshot[];
|
|
136
168
|
private stopCore;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
169
|
+
installOwnerLeaseRecoveryPublication(runtime: ZLinkLocationRuntime, spotNodeRuntime: ZLinkSpotNodeRuntimeManager, channelRuntime: ZLinkChannelRuntimeManager): void;
|
|
170
|
+
resumeOwnerLeaseOwnedWork(runtime: ZLinkLocationRuntime, spotNodeRuntime: ZLinkSpotNodeRuntimeManager, channelRuntime: ZLinkChannelRuntimeManager): Promise<void>;
|
|
171
|
+
enterServing(spotNodeRuntime: ZLinkSpotNodeRuntimeManager, signal: AbortSignal | undefined): Promise<void>;
|
|
140
172
|
private publishOrStayPreparing;
|
|
141
|
-
|
|
173
|
+
startStatefulAuthority(locationStore: import('../locations/domain-store-contract').ZLinkDomainLocationStore, spotNodeRuntime: ZLinkSpotNodeRuntimeManager, signal: AbortSignal | undefined): Promise<void>;
|
|
142
174
|
private createStatefulAuthorityRoutes;
|
|
143
175
|
private requiresStatefulAuthorityRuntime;
|
|
144
176
|
private installLocationBackedAuthorities;
|
|
145
|
-
|
|
177
|
+
removeOwnerLeaseRecoveryPublication(): void;
|
|
146
178
|
private ownerAdmissionOpen;
|
|
147
179
|
onApplicationBootstrap(): Promise<void>;
|
|
148
180
|
onApplicationShutdown(): Promise<void>;
|
|
@@ -151,10 +183,10 @@ export declare class ZLinkFrameworkRuntimeHost implements ZLinkFrameworkRuntimeL
|
|
|
151
183
|
private publishMeshRetiring;
|
|
152
184
|
private publishMeshServing;
|
|
153
185
|
private publishMeshDraining;
|
|
154
|
-
|
|
186
|
+
preflightAutomaticPeerReadiness(deadlineAt: number, targetApplicationVersion: bigint): Promise<ZLinkFrameworkRelocationReason | undefined>;
|
|
155
187
|
private hasLocalStatefulRelocationWork;
|
|
156
188
|
private hasExactAutomaticPeerReadiness;
|
|
157
|
-
|
|
189
|
+
publishHostRelocated(): Promise<void>;
|
|
158
190
|
private publishHostDraining;
|
|
159
191
|
private cleanupOwnerForDrain;
|
|
160
192
|
private registerInstanceApplicationLifecycle;
|
|
@@ -167,24 +199,61 @@ export declare class ZLinkFrameworkRuntimeHost implements ZLinkFrameworkRuntimeL
|
|
|
167
199
|
createPublicSpotManager(local: DefaultZLinkSpotManager): import('../../contracts').ZLinkSpotManager;
|
|
168
200
|
private actorRuntimeOptionsFactory;
|
|
169
201
|
private createChannelRuntimeOptions;
|
|
170
|
-
|
|
202
|
+
createSpotNodeRuntimeOptions(context: ZLinkBackendContext, dispatchErrors: ZLinkDispatchErrorReporter): {
|
|
203
|
+
admission: ZLinkRuntimeAdmissionGate;
|
|
204
|
+
errorSink: ZLinkDispatchErrorSink;
|
|
205
|
+
peerAdmissionSealed: (meshName: string) => boolean;
|
|
206
|
+
messageFollowReceiver: (record: ServiceMessageFollowRecord) => void;
|
|
207
|
+
meshRecordDispatcher: (meshName: string, owner: ReadyRecord, record: ReceiveRecord) => void | Promise<void>;
|
|
208
|
+
activationConcurrency: (meshName: string) => import("../activation-admission").ZLinkActivationConcurrency;
|
|
209
|
+
context: ZLinkBackendContext;
|
|
210
|
+
applicationJobQueue?: ApplicationJobQueue;
|
|
211
|
+
registration: ZLinkFrameworkRegistration;
|
|
212
|
+
messageSerializers?: ReadonlyMap<string, import("../../contracts").ZLinkMessageSerializer>;
|
|
213
|
+
providerResolver?: ZLinkProviderResolver;
|
|
214
|
+
metrics?: import("../diagnostics").ZLinkRuntimeMetrics;
|
|
215
|
+
spotRouterChannelIdForMesh?: (meshName: string) => string;
|
|
216
|
+
runtimeEventPublisher?: ZLinkRuntimeEventPublisher;
|
|
217
|
+
actorHandoffRuntime?: import("../spots/spot-runtime-ports").ZLinkSpotActorHandoffRuntime;
|
|
218
|
+
actorTransferRuntime?: import("../spots/spot-runtime-ports").ZLinkSpotActorTransferRuntime;
|
|
219
|
+
boundSessionRuntime?: import("../spots/spot-runtime-ports").ZLinkSpotBoundSessionRuntime;
|
|
220
|
+
detachedTaskRunner: ZLinkDetachedTaskRunner;
|
|
221
|
+
dispatchErrors?: ZLinkDispatchErrorReporter;
|
|
222
|
+
channelClient?: import("../../contracts").ZLinkChannelClient;
|
|
223
|
+
fanoutClient?: import("../../contracts").ZLinkFanoutClient;
|
|
224
|
+
spotPublisherClient?: import("../../contracts").ZLinkSpotPublisherClient;
|
|
225
|
+
routedTransport?: import("../spots").ZLinkSpotRoutedTransport;
|
|
226
|
+
requests?: RequestRuntime;
|
|
227
|
+
listenerRecords?: ZLinkListenerRecords;
|
|
228
|
+
primaryMeshName?: string;
|
|
229
|
+
backendAdapterFactory: ZLinkBackendAdapterFactory;
|
|
230
|
+
spotRouteResolver?: ZLinkSpotRouteResolver;
|
|
231
|
+
entryActorRuntime?: import("../spots/spot-runtime-ports").ZLinkEntryActorRuntime;
|
|
232
|
+
applicationJobReceiveFlowFailureSink?: (error: unknown) => void;
|
|
233
|
+
};
|
|
171
234
|
private dispatchMeshNodeRecord;
|
|
172
235
|
private dispatchMeshNodePayload;
|
|
173
236
|
private completeFormalSourceLeave;
|
|
174
|
-
|
|
237
|
+
dispatchMeshRecord(applicationJobOrigin: () => ApplicationJobOrigin, meshName: string, owner: ReadyRecord, record: ReceiveRecord, signal?: AbortSignal): void | Promise<void>;
|
|
175
238
|
private admitMeshDispatch;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
239
|
+
dispatchMeshActorBinding(meshName: string, record: ReceiveRecord, signal?: AbortSignal): Promise<void>;
|
|
240
|
+
submitLocalMeshRoute(meshName: string, sourceNodeRid: string, parts: readonly MessageLike[]): {
|
|
241
|
+
readonly status: ZLinkSubmitStatus.Shutdown;
|
|
242
|
+
} | {
|
|
243
|
+
readonly status: ZLinkSubmitStatus.TargetNotFound;
|
|
244
|
+
} | {
|
|
245
|
+
readonly status: ZLinkSubmitStatus.Submitted;
|
|
246
|
+
};
|
|
247
|
+
dispatchMeshSpotRecord(meshName: string, owner: ReadyRecord, record: ReceiveRecord, admit?: ZLinkMeshDispatchAdmission): Promise<void>;
|
|
248
|
+
createDispatchErrorReporter(errorSink: ZLinkDispatchErrorSink): ZLinkDispatchErrorReporter;
|
|
180
249
|
detachedTaskRunner(): ZLinkDetachedTaskRunner;
|
|
181
250
|
private diagnosticsContext;
|
|
182
|
-
|
|
251
|
+
flowCreationEnabled(): boolean;
|
|
183
252
|
private runLifecycle;
|
|
184
253
|
requirePrimaryMeshNode(): ZLinkBackendMeshNode;
|
|
185
254
|
private ensureLocationRuntime;
|
|
186
|
-
|
|
187
|
-
|
|
255
|
+
createLocationSpotRouteResolver(): ZLinkSpotRouteResolver | undefined;
|
|
256
|
+
createActorLocationResolver(): ZLinkStoreLocationResolvers | undefined;
|
|
188
257
|
}
|
|
189
258
|
export declare function hasUnsupportedManualTopology(registration: ZLinkFrameworkRegistration): boolean;
|
|
190
259
|
export declare function hasExactPeerReadiness(descriptors: readonly ZLinkMeshNodeDescriptor[], local: {
|