@almadar/runtime 6.18.0 → 6.19.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/{OrbitalServerRuntime-CJWejtSD.d.ts → OrbitalServerRuntime-TewGACFH.d.ts} +1 -0
- package/dist/OrbitalServerRuntime.d.ts +1 -1
- package/dist/OrbitalServerRuntime.js +11 -7
- package/dist/OrbitalServerRuntime.js.map +1 -1
- package/dist/{chunk-G2VW5WJZ.js → chunk-JZ4IDIUU.js} +89 -3
- package/dist/chunk-JZ4IDIUU.js.map +1 -0
- package/dist/index.d.ts +46 -3
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-G2VW5WJZ.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'express';
|
|
2
|
-
export { C as ClientEffectTuple, D as ClientNavigateTuple, F as ClientNotifyTuple, G as ClientRenderUITuple, H as EffectResult, J as LoaderConfig, O as OrbitalEventRequest, e as OrbitalEventResponse, K as OrbitalServerRuntime, f as OrbitalServerRuntimeConfig, R as RegisteredOrbital, j as RuntimeOrbital, k as RuntimeOrbitalSchema, l as RuntimeTrait, M as RuntimeTraitTick, n as collectDeclaredConfigDefaults, N as createOrbitalServerRuntime } from './OrbitalServerRuntime-
|
|
2
|
+
export { C as ClientEffectTuple, D as ClientNavigateTuple, F as ClientNotifyTuple, G as ClientRenderUITuple, H as EffectResult, J as LoaderConfig, O as OrbitalEventRequest, e as OrbitalEventResponse, K as OrbitalServerRuntime, f as OrbitalServerRuntimeConfig, R as RegisteredOrbital, j as RuntimeOrbital, k as RuntimeOrbitalSchema, l as RuntimeTrait, M as RuntimeTraitTick, n as collectDeclaredConfigDefaults, N as createOrbitalServerRuntime } from './OrbitalServerRuntime-TewGACFH.js';
|
|
3
3
|
import './types-BA7GoDni.js';
|
|
4
4
|
import '@almadar/core';
|
|
5
5
|
export { I as InMemoryPersistence, P as PersistenceAdapter } from './PersistenceAdapter-B6dQCbbU.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventBus, createUnifiedLoader, MockPersistenceAdapter, InMemoryPersistence, preprocessSchema, StateMachineManager, createContextFromBindings, validateEventPayload, formatPayloadValidationError, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, EffectExecutor } from './chunk-
|
|
2
|
-
export { InMemoryPersistence, collectDeclaredConfigDefaults } from './chunk-
|
|
1
|
+
import { createTickScheduler, EventBus, createUnifiedLoader, MockPersistenceAdapter, InMemoryPersistence, preprocessSchema, StateMachineManager, createContextFromBindings, validateEventPayload, formatPayloadValidationError, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, EffectExecutor } from './chunk-JZ4IDIUU.js';
|
|
2
|
+
export { InMemoryPersistence, collectDeclaredConfigDefaults } from './chunk-JZ4IDIUU.js';
|
|
3
3
|
import './chunk-PZ5AY32C.js';
|
|
4
4
|
import { createLogger } from '@almadar/logger';
|
|
5
5
|
import * as nodeModule from 'module';
|
|
@@ -59,6 +59,10 @@ var OrbitalServerRuntime = class {
|
|
|
59
59
|
persistence;
|
|
60
60
|
listenerCleanups = [];
|
|
61
61
|
tickBindings = [];
|
|
62
|
+
// One coalesced clock for every tick this runtime registers — replaces
|
|
63
|
+
// "one setInterval per tick" with a single accumulator loop so ticks due
|
|
64
|
+
// in the same pass fire together instead of on independent timers.
|
|
65
|
+
tickScheduler = createTickScheduler();
|
|
62
66
|
loader = null;
|
|
63
67
|
preprocessedCache = /* @__PURE__ */ new Map();
|
|
64
68
|
entitySharingMap = {};
|
|
@@ -615,14 +619,14 @@ var OrbitalServerRuntime = class {
|
|
|
615
619
|
intervalMs
|
|
616
620
|
});
|
|
617
621
|
}
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
}
|
|
622
|
+
const handle = this.tickScheduler.add(intervalMs, () => {
|
|
623
|
+
void this.executeTick(orbitalName, traitName, tick, registered);
|
|
624
|
+
});
|
|
621
625
|
this.tickBindings.push({
|
|
622
626
|
orbitalName,
|
|
623
627
|
traitName,
|
|
624
628
|
tick,
|
|
625
|
-
|
|
629
|
+
handle
|
|
626
630
|
});
|
|
627
631
|
}
|
|
628
632
|
/**
|
|
@@ -737,7 +741,7 @@ var OrbitalServerRuntime = class {
|
|
|
737
741
|
*/
|
|
738
742
|
cleanupTicks() {
|
|
739
743
|
for (const binding of this.tickBindings) {
|
|
740
|
-
|
|
744
|
+
binding.handle.stop();
|
|
741
745
|
}
|
|
742
746
|
this.tickBindings = [];
|
|
743
747
|
}
|