Impove workload failure/success flipping and update demos
This commit is contained in:
@@ -29,11 +29,18 @@ store.dispatch(WorkloadActions.updateStatus({ id: 0, status: 'SUCCESS' }));
|
|||||||
|
|
||||||
const workloadService = new WorkloadService();
|
const workloadService = new WorkloadService();
|
||||||
|
|
||||||
workloadService.create({ complexity: 100 }).then(console.log.bind(console, 'create'));
|
workloadService.create({ complexity: 1 }).then(console.log.bind(console, 'create 0'));
|
||||||
workloadService.cancel({ id: 0 }).then(console.log.bind(console, 'cancel'));
|
workloadService.cancel({ id: 0 }).then(console.log.bind(console, 'cancel 0'));
|
||||||
|
setTimeout(() => workloadService.checkStatus({ id: 0 }).then(console.log.bind(console, 'checkStatus 0')), 100)
|
||||||
|
|
||||||
|
workloadService.create({ complexity: 2 }).then(console.log.bind(console, 'create 1'));
|
||||||
|
workloadService.checkStatus({ id: 1 }).then(console.log.bind(console, 'checkStatus 1'));
|
||||||
|
setTimeout(() => workloadService.checkStatus({ id: 1 }).then(console.log.bind(console, 'checkStatus 1')), 200)
|
||||||
|
|
||||||
|
workloadService.create({ complexity: 2 }).then(console.log.bind(console, 'create 2'));
|
||||||
|
workloadService.checkStatus({ id: 2 }).then(console.log.bind(console, 'checkStatus 2'));
|
||||||
|
setTimeout(() => workloadService.checkStatus({ id: 2 }).then(console.log.bind(console, 'checkStatus 2')), 200)
|
||||||
|
|
||||||
workloadService.create({ complexity: 200 }).then(console.log.bind(console, 'create'));
|
|
||||||
workloadService.checkStatus({ id: 1 }).then(console.log.bind(console, 'checkStatus'));
|
|
||||||
|
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ export class WorkloadService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private completeWorkload(work: Work) {
|
private completeWorkload(work: Work) {
|
||||||
work.status = this.counter % 2
|
work.status = work.id % 2
|
||||||
? 'SUCCESS'
|
? 'FAILURE'
|
||||||
: 'FAILURE';
|
: 'SUCCESS';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user