Skip to content

Commit 63d5b76

Browse files
Merge branch 'master' of github.com:bigstepinc/jsonrpc-bidirectional
2 parents 2c800a2 + 82e35e1 commit 63d5b76

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/NodeMultiCoreCPUBase/WorkerEndpoint.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class WorkerEndpoint extends JSONRPC.EndpointBase
3737

3838
this._bWorkerStarted = false;
3939

40-
this._nPersistentWorkerID = null;
40+
this._nPersistentWorkerID = undefined;
4141
}
4242

4343

@@ -81,8 +81,13 @@ class WorkerEndpoint extends JSONRPC.EndpointBase
8181
return this._masterClient;
8282
}
8383

84-
get persistentWorkerID()
84+
async getIfNotPresentPersistentWorkerID()
8585
{
86+
if(this._nPersistentWorkerID === undefined)
87+
{
88+
this._nPersistentWorkerID = await this._masterClient.getPersistentIDForWorkerID();
89+
}
90+
8691
return this._nPersistentWorkerID;
8792
}
8893

@@ -100,8 +105,6 @@ class WorkerEndpoint extends JSONRPC.EndpointBase
100105
{
101106
throw new Error("This mustn't be called through JSONRPC.");
102107
}
103-
104-
this._nPersistentWorkerID = await this._masterClient.getPersistentIDForWorkerID();
105108
}
106109

107110

0 commit comments

Comments
 (0)