forked from cory/tildefriends
js: Kill getSessionProcessBlob.
This commit is contained in:
parent
97661e2ca2
commit
68817feeec
@ -10,7 +10,7 @@ let gSessionIndex = 0;
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
function makeSessionId() {
|
function makeSessionId() {
|
||||||
return (gSessionIndex++).toString();
|
return 'session_' + (gSessionIndex++).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -172,7 +172,7 @@ async function socket(request, response, client) {
|
|||||||
0x1
|
0x1
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
process = await core.getSessionProcessBlob(
|
process = await core.getProcessBlob(
|
||||||
blobId,
|
blobId,
|
||||||
sessionId,
|
sessionId,
|
||||||
options
|
options
|
||||||
|
21
core/core.js
21
core/core.js
@ -258,23 +258,6 @@ function postMessageInternal(from, to, message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* TODOC
|
|
||||||
* @param {*} blobId
|
|
||||||
* @param {*} session
|
|
||||||
* @param {*} options
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
async function getSessionProcessBlob(blobId, session, options) {
|
|
||||||
let actualOptions = {timeout: kPingInterval};
|
|
||||||
if (options) {
|
|
||||||
for (let i in options) {
|
|
||||||
actualOptions[i] = options[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return getProcessBlob(blobId, 'session_' + session, actualOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODOC
|
* TODOC
|
||||||
* @param {*} blobId
|
* @param {*} blobId
|
||||||
@ -302,7 +285,7 @@ async function getProcessBlob(blobId, key, options) {
|
|||||||
}
|
}
|
||||||
process.lastActive = Date.now();
|
process.lastActive = Date.now();
|
||||||
process.lastPing = null;
|
process.lastPing = null;
|
||||||
process.timeout = options.timeout;
|
process.timeout = kPingInterval;
|
||||||
process.ready = new Promise(function (resolve, reject) {
|
process.ready = new Promise(function (resolve, reject) {
|
||||||
resolveReady = resolve;
|
resolveReady = resolve;
|
||||||
rejectReady = reject;
|
rejectReady = reject;
|
||||||
@ -1302,4 +1285,4 @@ async function storePermission(user, packageOwner, packageName, permission, allo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {invoke, getSessionProcessBlob};
|
export {invoke, getProcessBlob};
|
||||||
|
Loading…
Reference in New Issue
Block a user