@taskcluster/client-web 95.1.3 → 96.0.0
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/package.json +1 -1
- package/src/clients/WorkerManager.js +14 -0
package/package.json
CHANGED
|
@@ -30,6 +30,7 @@ export default class WorkerManager extends Client {
|
|
|
30
30
|
this.createWorker.entry = {"args":["workerPoolId","workerGroup","workerId"],"category":"Workers","input":true,"method":"put","name":"createWorker","output":true,"query":[],"route":"/workers/<workerPoolId>/<workerGroup>/<workerId>","scopes":"worker-manager:create-worker:<workerPoolId>/<workerGroup>/<workerId>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
31
31
|
this.updateWorker.entry = {"args":["workerPoolId","workerGroup","workerId"],"category":"Workers","input":true,"method":"post","name":"updateWorker","output":true,"query":[],"route":"/workers/<workerPoolId>/<workerGroup>/<workerId>","scopes":"worker-manager:update-worker:<workerPoolId>/<workerGroup>/<workerId>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
32
32
|
this.removeWorker.entry = {"args":["workerPoolId","workerGroup","workerId"],"category":"Workers","method":"delete","name":"removeWorker","query":[],"route":"/workers/<workerPoolId>/<workerGroup>/<workerId>","scopes":"worker-manager:remove-worker:<workerPoolId>/<workerGroup>/<workerId>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
33
|
+
this.shouldWorkerTerminate.entry = {"args":["workerPoolId","workerGroup","workerId"],"category":"Workers","method":"get","name":"shouldWorkerTerminate","output":true,"query":[],"route":"/workers/<workerPoolId>/<workerGroup>/<workerId>/should-terminate","scopes":"worker-manager:should-worker-terminate:<workerPoolId>/<workerGroup>/<workerId>","stability":"experimental","type":"function"}; // eslint-disable-line
|
|
33
34
|
this.listWorkersForWorkerPool.entry = {"args":["workerPoolId"],"category":"Workers","method":"get","name":"listWorkersForWorkerPool","output":true,"query":["continuationToken","limit","launchConfigId","state"],"route":"/workers/<workerPoolId>","scopes":"worker-manager:list-workers:<workerPoolId>","stability":"stable","type":"function"}; // eslint-disable-line
|
|
34
35
|
this.registerWorker.entry = {"args":[],"category":"Worker Interface","input":true,"method":"post","name":"registerWorker","output":true,"query":[],"route":"/worker/register","stability":"stable","type":"function"}; // eslint-disable-line
|
|
35
36
|
this.reregisterWorker.entry = {"args":[],"category":"Worker Interface","input":true,"method":"post","name":"reregisterWorker","output":true,"query":[],"route":"/worker/reregister","scopes":"worker-manager:reregister-worker:<workerPoolId>/<workerGroup>/<workerId>","stability":"experimental","type":"function"}; // eslint-disable-line
|
|
@@ -236,6 +237,19 @@ export default class WorkerManager extends Client {
|
|
|
236
237
|
return this.request(this.removeWorker.entry, args);
|
|
237
238
|
}
|
|
238
239
|
/* eslint-disable max-len */
|
|
240
|
+
// Informs if worker should terminate or keep working.
|
|
241
|
+
// Worker might no longer be needed based on the set of factors:
|
|
242
|
+
// - current capacity of the worker pool
|
|
243
|
+
// - amount of pending and claimed tasks
|
|
244
|
+
// - launch configuration changes
|
|
245
|
+
// Decision is made during provision or scanning loop based on above mentioned conditions.
|
|
246
|
+
/* eslint-enable max-len */
|
|
247
|
+
shouldWorkerTerminate(...args) {
|
|
248
|
+
this.validate(this.shouldWorkerTerminate.entry, args);
|
|
249
|
+
|
|
250
|
+
return this.request(this.shouldWorkerTerminate.entry, args);
|
|
251
|
+
}
|
|
252
|
+
/* eslint-disable max-len */
|
|
239
253
|
// Get the list of all the existing workers in a given worker pool.
|
|
240
254
|
/* eslint-enable max-len */
|
|
241
255
|
listWorkersForWorkerPool(...args) {
|