@fuzionx/core 0.1.73 → 0.1.74

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.
Files changed (2) hide show
  1. package/lib/ws.js +12 -2
  2. package/package.json +2 -2
package/lib/ws.js CHANGED
@@ -98,7 +98,7 @@ class FuzionXSocket {
98
98
  class WsNamespace {
99
99
  constructor(path) {
100
100
  this.path = path;
101
- this._handlers = { connect: null, message: null, disconnect: null };
101
+ this._handlers = { connect: null, message: null, disconnect: null, metadata_update: null };
102
102
  }
103
103
 
104
104
  /**
@@ -108,7 +108,7 @@ class WsNamespace {
108
108
  * @returns {WsNamespace} 체이닝 지원
109
109
  */
110
110
  on(event, handler) {
111
- if (!['connect', 'message', 'disconnect'].includes(event)) {
111
+ if (!['connect', 'message', 'disconnect', 'metadata_update'].includes(event)) {
112
112
  throw new Error(`Unknown WS event: ${event}`);
113
113
  }
114
114
  this._handlers[event] = handler;
@@ -152,6 +152,16 @@ export function createWs(bridge) {
152
152
  ns._handlers.disconnect(new FuzionXSocket(sessionId, bridge, namespace));
153
153
  }
154
154
  });
155
+
156
+ // metadata_update 이벤트 디스패쳐 (Hub 원격 메타데이터 변경)
157
+ if (typeof bridge.wsOnMetadataUpdate === 'function') {
158
+ bridge.wsOnMetadataUpdate((namespace, sessionId, key, value) => {
159
+ const ns = namespaces.get(namespace);
160
+ if (ns && ns._handlers.metadata_update) {
161
+ ns._handlers.metadata_update(new FuzionXSocket(sessionId, bridge, namespace), key, value);
162
+ }
163
+ });
164
+ }
155
165
  }
156
166
 
157
167
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzionx/core",
3
- "version": "0.1.73",
3
+ "version": "0.1.74",
4
4
  "type": "module",
5
5
  "description": "Express-style Node.js framework powered by FuzionX native bridge — 167K RPS single process",
6
6
  "main": "index.js",
@@ -27,7 +27,7 @@
27
27
  "url": "https://github.com/saytohenry/fuzionx"
28
28
  },
29
29
  "dependencies": {
30
- "@fuzionx/bridge": "^0.1.73"
30
+ "@fuzionx/bridge": "^0.1.74"
31
31
  },
32
32
  "files": [
33
33
  "index.js",