@cadenza.io/service 2.3.11 → 2.3.12
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 +13 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1717,20 +1717,11 @@ var SocketController = class _SocketController {
|
|
|
1717
1717
|
CadenzaService.log("Socket setup error: No server", {}, "error");
|
|
1718
1718
|
return { ...ctx, __error: "No server", errored: true };
|
|
1719
1719
|
}
|
|
1720
|
-
const handshakeMap = {};
|
|
1721
1720
|
server.on("connection", (ws) => {
|
|
1722
1721
|
try {
|
|
1723
1722
|
ws.on(
|
|
1724
1723
|
"handshake",
|
|
1725
1724
|
(ctx2, callback) => {
|
|
1726
|
-
if (handshakeMap[ctx2.serviceInstanceId]) {
|
|
1727
|
-
callback({
|
|
1728
|
-
status: "error",
|
|
1729
|
-
error: "Duplicate handshake"
|
|
1730
|
-
});
|
|
1731
|
-
return;
|
|
1732
|
-
}
|
|
1733
|
-
handshakeMap[ctx2.serviceInstanceId] = true;
|
|
1734
1725
|
CadenzaService.log("SocketServer: New connection", {
|
|
1735
1726
|
...ctx2,
|
|
1736
1727
|
socketId: ws.id
|
|
@@ -1766,6 +1757,10 @@ var SocketController = class _SocketController {
|
|
|
1766
1757
|
"delegation",
|
|
1767
1758
|
(ctx2, callback) => {
|
|
1768
1759
|
const deputyExecId = ctx2.__metadata.__deputyExecId;
|
|
1760
|
+
console.log(
|
|
1761
|
+
"Delegation request received:",
|
|
1762
|
+
ctx2.__localTaskName
|
|
1763
|
+
);
|
|
1769
1764
|
CadenzaService.createEphemeralMetaTask(
|
|
1770
1765
|
"Resolve delegation",
|
|
1771
1766
|
(ctx3) => {
|
|
@@ -1800,6 +1795,7 @@ var SocketController = class _SocketController {
|
|
|
1800
1795
|
"signal",
|
|
1801
1796
|
(ctx2, callback) => {
|
|
1802
1797
|
if (CadenzaService.signalBroker.listObservedSignals().includes(ctx2.__signalName)) {
|
|
1798
|
+
console.log("Signal received:", ctx2.__signalName);
|
|
1803
1799
|
callback({
|
|
1804
1800
|
__status: "success",
|
|
1805
1801
|
__signalName: ctx2.__signalName
|
|
@@ -2078,6 +2074,7 @@ var SocketController = class _SocketController {
|
|
|
2078
2074
|
delete ctx2.__broadcast;
|
|
2079
2075
|
const requestSentAt = Date.now();
|
|
2080
2076
|
pendingDelegationIds.add(ctx2.__metadata.__deputyExecId);
|
|
2077
|
+
console.log("Delegating task:", ctx2.__remoteRoutineName);
|
|
2081
2078
|
emitWhenReady?.(
|
|
2082
2079
|
"delegation",
|
|
2083
2080
|
ctx2,
|
|
@@ -2086,6 +2083,12 @@ var SocketController = class _SocketController {
|
|
|
2086
2083
|
const requestDuration = Date.now() - requestSentAt;
|
|
2087
2084
|
const metadata = resultContext.__metadata;
|
|
2088
2085
|
delete resultContext.__metadata;
|
|
2086
|
+
console.log(
|
|
2087
|
+
"Delegation response received:",
|
|
2088
|
+
ctx2.__remoteRoutineName,
|
|
2089
|
+
"Duration:",
|
|
2090
|
+
requestDuration
|
|
2091
|
+
);
|
|
2089
2092
|
emit(
|
|
2090
2093
|
`meta.socket_client.delegated:${ctx2.__metadata.__deputyExecId}`,
|
|
2091
2094
|
{
|
|
@@ -2120,6 +2123,7 @@ var SocketController = class _SocketController {
|
|
|
2120
2123
|
}
|
|
2121
2124
|
return new Promise((resolve) => {
|
|
2122
2125
|
delete ctx2.__broadcast;
|
|
2126
|
+
console.log("Transmitting signal:", ctx2.__signalName);
|
|
2123
2127
|
emitWhenReady?.("signal", ctx2, 5e3, (response) => {
|
|
2124
2128
|
if (ctx2.__routineExecId) {
|
|
2125
2129
|
emit(
|