@cadenza.io/service 2.3.11 → 2.3.13
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/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -562,6 +562,9 @@ var ServiceRegistry = class _ServiceRegistry {
|
|
|
562
562
|
}
|
|
563
563
|
).then(this.handleGlobalSignalRegistrationTask);
|
|
564
564
|
this.fullSyncTask = CadenzaService.createMetaRoutine("Full sync", [
|
|
565
|
+
CadenzaService.createTask("Confirm full sync", () => {
|
|
566
|
+
console.log("Confirming full sync...");
|
|
567
|
+
}),
|
|
565
568
|
CadenzaService.createCadenzaDBQueryTask("signal_to_task_map", {
|
|
566
569
|
filter: {
|
|
567
570
|
isGlobal: true
|
|
@@ -1765,20 +1768,11 @@ var SocketController = class _SocketController {
|
|
|
1765
1768
|
CadenzaService.log("Socket setup error: No server", {}, "error");
|
|
1766
1769
|
return { ...ctx, __error: "No server", errored: true };
|
|
1767
1770
|
}
|
|
1768
|
-
const handshakeMap = {};
|
|
1769
1771
|
server.on("connection", (ws) => {
|
|
1770
1772
|
try {
|
|
1771
1773
|
ws.on(
|
|
1772
1774
|
"handshake",
|
|
1773
1775
|
(ctx2, callback) => {
|
|
1774
|
-
if (handshakeMap[ctx2.serviceInstanceId]) {
|
|
1775
|
-
callback({
|
|
1776
|
-
status: "error",
|
|
1777
|
-
error: "Duplicate handshake"
|
|
1778
|
-
});
|
|
1779
|
-
return;
|
|
1780
|
-
}
|
|
1781
|
-
handshakeMap[ctx2.serviceInstanceId] = true;
|
|
1782
1776
|
CadenzaService.log("SocketServer: New connection", {
|
|
1783
1777
|
...ctx2,
|
|
1784
1778
|
socketId: ws.id
|
|
@@ -1814,6 +1808,10 @@ var SocketController = class _SocketController {
|
|
|
1814
1808
|
"delegation",
|
|
1815
1809
|
(ctx2, callback) => {
|
|
1816
1810
|
const deputyExecId = ctx2.__metadata.__deputyExecId;
|
|
1811
|
+
console.log(
|
|
1812
|
+
"Delegation request received:",
|
|
1813
|
+
ctx2.__localTaskName
|
|
1814
|
+
);
|
|
1817
1815
|
CadenzaService.createEphemeralMetaTask(
|
|
1818
1816
|
"Resolve delegation",
|
|
1819
1817
|
(ctx3) => {
|
|
@@ -1848,6 +1846,7 @@ var SocketController = class _SocketController {
|
|
|
1848
1846
|
"signal",
|
|
1849
1847
|
(ctx2, callback) => {
|
|
1850
1848
|
if (CadenzaService.signalBroker.listObservedSignals().includes(ctx2.__signalName)) {
|
|
1849
|
+
console.log("Signal received:", ctx2.__signalName);
|
|
1851
1850
|
callback({
|
|
1852
1851
|
__status: "success",
|
|
1853
1852
|
__signalName: ctx2.__signalName
|
|
@@ -2126,6 +2125,7 @@ var SocketController = class _SocketController {
|
|
|
2126
2125
|
delete ctx2.__broadcast;
|
|
2127
2126
|
const requestSentAt = Date.now();
|
|
2128
2127
|
pendingDelegationIds.add(ctx2.__metadata.__deputyExecId);
|
|
2128
|
+
console.log("Delegating task:", ctx2.__remoteRoutineName);
|
|
2129
2129
|
emitWhenReady?.(
|
|
2130
2130
|
"delegation",
|
|
2131
2131
|
ctx2,
|
|
@@ -2134,6 +2134,12 @@ var SocketController = class _SocketController {
|
|
|
2134
2134
|
const requestDuration = Date.now() - requestSentAt;
|
|
2135
2135
|
const metadata = resultContext.__metadata;
|
|
2136
2136
|
delete resultContext.__metadata;
|
|
2137
|
+
console.log(
|
|
2138
|
+
"Delegation response received:",
|
|
2139
|
+
ctx2.__remoteRoutineName,
|
|
2140
|
+
"Duration:",
|
|
2141
|
+
requestDuration
|
|
2142
|
+
);
|
|
2137
2143
|
emit(
|
|
2138
2144
|
`meta.socket_client.delegated:${ctx2.__metadata.__deputyExecId}`,
|
|
2139
2145
|
{
|
|
@@ -2168,6 +2174,7 @@ var SocketController = class _SocketController {
|
|
|
2168
2174
|
}
|
|
2169
2175
|
return new Promise((resolve) => {
|
|
2170
2176
|
delete ctx2.__broadcast;
|
|
2177
|
+
console.log("Transmitting signal:", ctx2.__signalName);
|
|
2171
2178
|
emitWhenReady?.("signal", ctx2, 5e3, (response) => {
|
|
2172
2179
|
if (ctx2.__routineExecId) {
|
|
2173
2180
|
emit(
|