pssdk 3.0.0-alpha.2 → 3.0.0-alpha.4
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/appServer.js +7 -3
- package/package.json +1 -1
- package/threadableCI.js +4 -6
package/appServer.js
CHANGED
|
@@ -5,9 +5,10 @@ const path = require('path');
|
|
|
5
5
|
const ThreadableCI = require('./threadableCI.js');
|
|
6
6
|
|
|
7
7
|
class AppServer {
|
|
8
|
-
constructor(_appServerConfig
|
|
9
|
-
this.appServer =
|
|
10
|
-
|
|
8
|
+
constructor(_appServerConfig) {
|
|
9
|
+
this.appServer = typeof _appServerConfig === JavaAppServer
|
|
10
|
+
? _appServerConfig
|
|
11
|
+
: new JavaAppServer(_appServerConfig);
|
|
11
12
|
this.pool = new Piscina({
|
|
12
13
|
filename: path.resolve(__dirname, 'worker.js'),
|
|
13
14
|
idleTimeout: 60000,
|
|
@@ -21,6 +22,9 @@ class AppServer {
|
|
|
21
22
|
);
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
static fromEnv() {
|
|
26
|
+
return new AppServer(JavaAppServer.fromEnv());
|
|
27
|
+
}
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
module.exports = AppServer;
|
package/package.json
CHANGED
package/threadableCI.js
CHANGED
|
@@ -34,12 +34,6 @@ class TreadableCI {
|
|
|
34
34
|
.then(() => this);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
cancel() {
|
|
38
|
-
return this.pool
|
|
39
|
-
.run({ ci: this.ci }, { name: 'cancel' })
|
|
40
|
-
.then(() => this);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
37
|
execute(methodName, params) {
|
|
44
38
|
return this.pool
|
|
45
39
|
.run({ ci: this.ci, methodName, params }, { name: 'execute' })
|
|
@@ -59,6 +53,10 @@ class TreadableCI {
|
|
|
59
53
|
return this;
|
|
60
54
|
}
|
|
61
55
|
|
|
56
|
+
cancel() {
|
|
57
|
+
return this.ci.cancel();
|
|
58
|
+
}
|
|
59
|
+
|
|
62
60
|
/*********************************/
|
|
63
61
|
/******** HELPER METHODS *********/
|
|
64
62
|
/*********************************/
|