@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.js
CHANGED
|
@@ -1765,20 +1765,11 @@ var SocketController = class _SocketController {
|
|
|
1765
1765
|
CadenzaService.log("Socket setup error: No server", {}, "error");
|
|
1766
1766
|
return { ...ctx, __error: "No server", errored: true };
|
|
1767
1767
|
}
|
|
1768
|
-
const handshakeMap = {};
|
|
1769
1768
|
server.on("connection", (ws) => {
|
|
1770
1769
|
try {
|
|
1771
1770
|
ws.on(
|
|
1772
1771
|
"handshake",
|
|
1773
1772
|
(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
1773
|
CadenzaService.log("SocketServer: New connection", {
|
|
1783
1774
|
...ctx2,
|
|
1784
1775
|
socketId: ws.id
|
|
@@ -1814,6 +1805,10 @@ var SocketController = class _SocketController {
|
|
|
1814
1805
|
"delegation",
|
|
1815
1806
|
(ctx2, callback) => {
|
|
1816
1807
|
const deputyExecId = ctx2.__metadata.__deputyExecId;
|
|
1808
|
+
console.log(
|
|
1809
|
+
"Delegation request received:",
|
|
1810
|
+
ctx2.__localTaskName
|
|
1811
|
+
);
|
|
1817
1812
|
CadenzaService.createEphemeralMetaTask(
|
|
1818
1813
|
"Resolve delegation",
|
|
1819
1814
|
(ctx3) => {
|
|
@@ -1848,6 +1843,7 @@ var SocketController = class _SocketController {
|
|
|
1848
1843
|
"signal",
|
|
1849
1844
|
(ctx2, callback) => {
|
|
1850
1845
|
if (CadenzaService.signalBroker.listObservedSignals().includes(ctx2.__signalName)) {
|
|
1846
|
+
console.log("Signal received:", ctx2.__signalName);
|
|
1851
1847
|
callback({
|
|
1852
1848
|
__status: "success",
|
|
1853
1849
|
__signalName: ctx2.__signalName
|
|
@@ -2126,6 +2122,7 @@ var SocketController = class _SocketController {
|
|
|
2126
2122
|
delete ctx2.__broadcast;
|
|
2127
2123
|
const requestSentAt = Date.now();
|
|
2128
2124
|
pendingDelegationIds.add(ctx2.__metadata.__deputyExecId);
|
|
2125
|
+
console.log("Delegating task:", ctx2.__remoteRoutineName);
|
|
2129
2126
|
emitWhenReady?.(
|
|
2130
2127
|
"delegation",
|
|
2131
2128
|
ctx2,
|
|
@@ -2134,6 +2131,12 @@ var SocketController = class _SocketController {
|
|
|
2134
2131
|
const requestDuration = Date.now() - requestSentAt;
|
|
2135
2132
|
const metadata = resultContext.__metadata;
|
|
2136
2133
|
delete resultContext.__metadata;
|
|
2134
|
+
console.log(
|
|
2135
|
+
"Delegation response received:",
|
|
2136
|
+
ctx2.__remoteRoutineName,
|
|
2137
|
+
"Duration:",
|
|
2138
|
+
requestDuration
|
|
2139
|
+
);
|
|
2137
2140
|
emit(
|
|
2138
2141
|
`meta.socket_client.delegated:${ctx2.__metadata.__deputyExecId}`,
|
|
2139
2142
|
{
|
|
@@ -2168,6 +2171,7 @@ var SocketController = class _SocketController {
|
|
|
2168
2171
|
}
|
|
2169
2172
|
return new Promise((resolve) => {
|
|
2170
2173
|
delete ctx2.__broadcast;
|
|
2174
|
+
console.log("Transmitting signal:", ctx2.__signalName);
|
|
2171
2175
|
emitWhenReady?.("signal", ctx2, 5e3, (response) => {
|
|
2172
2176
|
if (ctx2.__routineExecId) {
|
|
2173
2177
|
emit(
|