Tilde Friends server-side app wrapper.
◆ App()
App constructor.
- Returns
- An app instance.
◆ app_socket
App socket handler.
- Parameters
-
request | The HTTP request of the WebSocket connection. |
response | The HTTP response. |
◆ g_session_index
A sequence number of apps.
◆ makeFunction
App prototype makeFunction |
Initial value:= function (api) {
let self = this;
let result = function () {
let id = self._next_call_id++;
while (!id || self.calls[id]) {
id = self._next_call_id++;
}
let promise = new Promise(function (resolve, reject) {
self.calls[id] = {resolve: resolve, reject: reject};
});
action: 'tfrpc',
method: api[0],
params: [...arguments],
id: id,
};
return promise;
};
Object.defineProperty(result, 'name', {value: api[0], writable: false});
return result;
}
function message(event)
Definition: client.js:1458
Create a function wrapper that when called invokes a function on the app itself.
- Parameters
-
api | The function and argument names. |
- Returns
- A function.
◆ send
Initial value:
if (this._send_queue) {
if (this._on_output) {
this._send_queue.forEach((x) => this._on_output(x));
this._send_queue = null;
}
}
}
}
Send a message to the app.
- Parameters
-
message | The message to send. |