Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
6115bae66b | |||
1be83af475 | |||
bd14c41edc | |||
d61b79282d | |||
1cba9245fe | |||
4b0db4da21 | |||
a6cd0cb579 | |||
bd6109d5ea |
@ -119,6 +119,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
npmci node install stable
|
npmci node install stable
|
||||||
npmci npm install
|
npmci npm install
|
||||||
pnpm install -g @gitzone/tsdoc
|
pnpm install -g @git.zone/tsdoc
|
||||||
npmci command tsdoc
|
npmci command tsdoc
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
18
package.json
18
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/taskbuffer",
|
"name": "@push.rocks/taskbuffer",
|
||||||
"version": "3.1.3",
|
"version": "3.1.7",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "flexible task management. TypeScript ready!",
|
"description": "flexible task management. TypeScript ready!",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@ -29,21 +29,21 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/taskbuffer#readme",
|
"homepage": "https://gitlab.com/pushrocks/taskbuffer#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@push.rocks/isounique": "^1.0.5",
|
"@push.rocks/lik": "^6.0.5",
|
||||||
"@push.rocks/lik": "^6.0.3",
|
|
||||||
"@push.rocks/smartdelay": "^3.0.5",
|
"@push.rocks/smartdelay": "^3.0.5",
|
||||||
"@push.rocks/smartlog": "^3.0.3",
|
"@push.rocks/smartlog": "^3.0.3",
|
||||||
"@push.rocks/smartpromise": "^4.0.3",
|
"@push.rocks/smartpromise": "^4.0.3",
|
||||||
"@push.rocks/smartrx": "^3.0.6",
|
"@push.rocks/smartrx": "^3.0.6",
|
||||||
"@push.rocks/smarttime": "^4.0.4"
|
"@push.rocks/smarttime": "^4.0.6",
|
||||||
|
"@push.rocks/smartunique": "^3.0.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.66",
|
"@git.zone/tsbuild": "^2.1.66",
|
||||||
"@gitzone/tsbundle": "^2.0.8",
|
"@git.zone/tsbundle": "^2.0.8",
|
||||||
"@gitzone/tsrun": "^1.2.44",
|
"@git.zone/tsrun": "^1.2.44",
|
||||||
"@gitzone/tstest": "^1.0.77",
|
"@git.zone/tstest": "^1.0.77",
|
||||||
"@push.rocks/tapbundle": "^5.0.15",
|
"@push.rocks/tapbundle": "^5.0.15",
|
||||||
"@types/node": "^20.4.10"
|
"@types/node": "^20.8.7"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
1175
pnpm-lock.yaml
generated
1175
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/taskbuffer',
|
name: '@push.rocks/taskbuffer',
|
||||||
version: '3.1.3',
|
version: '3.1.7',
|
||||||
description: 'flexible task management. TypeScript ready!'
|
description: 'flexible task management. TypeScript ready!'
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import * as plugins from './taskbuffer.plugins.js';
|
|||||||
*/
|
*/
|
||||||
export interface IDistributedTaskRequest {
|
export interface IDistributedTaskRequest {
|
||||||
submitterId: string;
|
submitterId: string;
|
||||||
|
requestResponseId: string;
|
||||||
taskName: string;
|
taskName: string;
|
||||||
taskVersion: string;
|
taskVersion: string;
|
||||||
taskExecutionTime: number;
|
taskExecutionTime: number;
|
||||||
@ -16,6 +17,7 @@ export interface IDistributedTaskRequest {
|
|||||||
|
|
||||||
export interface IDistributedTaskRequestResult {
|
export interface IDistributedTaskRequestResult {
|
||||||
submitterId: string;
|
submitterId: string;
|
||||||
|
requestResponseId: string;
|
||||||
considered: boolean;
|
considered: boolean;
|
||||||
rank: number;
|
rank: number;
|
||||||
reason: string;
|
reason: string;
|
||||||
|
@ -13,7 +13,7 @@ export interface ITaskManagerConstructorOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class TaskManager {
|
export class TaskManager {
|
||||||
public randomId = plugins.isounique.uni();
|
public randomId = plugins.smartunique.shortId();
|
||||||
public taskMap = new plugins.lik.ObjectMap<Task>();
|
public taskMap = new plugins.lik.ObjectMap<Task>();
|
||||||
private cronJobManager = new plugins.smarttime.CronManager();
|
private cronJobManager = new plugins.smarttime.CronManager();
|
||||||
public options: ITaskManagerConstructorOptions = {
|
public options: ITaskManagerConstructorOptions = {
|
||||||
@ -90,8 +90,10 @@ export class TaskManager {
|
|||||||
|
|
||||||
private async performDistributedConsultation(task: Task, triggerTime: number): Promise<IDistributedTaskRequestResult> {
|
private async performDistributedConsultation(task: Task, triggerTime: number): Promise<IDistributedTaskRequestResult> {
|
||||||
console.log('Found a distributed coordinator, performing consultation.');
|
console.log('Found a distributed coordinator, performing consultation.');
|
||||||
|
|
||||||
return this.options.distributedCoordinator.fireDistributedTaskRequest({
|
return this.options.distributedCoordinator.fireDistributedTaskRequest({
|
||||||
submitterId: this.randomId,
|
submitterId: this.randomId,
|
||||||
|
requestResponseId: plugins.smartunique.shortId(),
|
||||||
status: 'requesting',
|
status: 'requesting',
|
||||||
taskExecutionParallel: 1,
|
taskExecutionParallel: 1,
|
||||||
taskExecutionTime: triggerTime,
|
taskExecutionTime: triggerTime,
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import * as isounique from '@push.rocks/isounique';
|
|
||||||
import * as lik from '@push.rocks/lik';
|
import * as lik from '@push.rocks/lik';
|
||||||
import * as smartlog from '@push.rocks/smartlog';
|
import * as smartlog from '@push.rocks/smartlog';
|
||||||
import * as smartpromise from '@push.rocks/smartpromise';
|
import * as smartpromise from '@push.rocks/smartpromise';
|
||||||
import * as smartdelay from '@push.rocks/smartdelay';
|
import * as smartdelay from '@push.rocks/smartdelay';
|
||||||
import * as smartrx from '@push.rocks/smartrx';
|
import * as smartrx from '@push.rocks/smartrx';
|
||||||
import * as smarttime from '@push.rocks/smarttime';
|
import * as smarttime from '@push.rocks/smarttime';
|
||||||
|
import * as smartunique from '@push.rocks/smartunique';
|
||||||
|
|
||||||
export { isounique, lik, smartlog, smartpromise, smartdelay, smartrx, smarttime };
|
export { lik, smartlog, smartpromise, smartdelay, smartrx, smarttime, smartunique };
|
||||||
|
@ -3,9 +3,12 @@
|
|||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"useDefineForClassFields": false,
|
"useDefineForClassFields": false,
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"module": "ES2022",
|
"module": "NodeNext",
|
||||||
"moduleResolution": "nodenext",
|
"moduleResolution": "NodeNext",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": true
|
||||||
}
|
},
|
||||||
|
"exclude": [
|
||||||
|
"dist_*/**/*.d.ts"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user