forked from fanruan/fineui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
836 B
26 lines
836 B
2 years ago
|
import { WorkerAbilityTestMainThreadAction } from './action/action.worker_ability_test';
|
||
|
// 不需要一起打包的话则不需要引入这行
|
||
|
import { workerUrl } from 'fui-worker!../worker_thread/${workerName}_worker_thread';
|
||
|
|
||
|
class ${WorkerName}MainTreadWorker extends BI.Workers.MainThreadWorker {
|
||
|
private communicationTest: WorkerAbilityTestMainThreadAction;
|
||
|
|
||
|
public initActions(): void {
|
||
|
this.communicationTest = this.createAction(WorkerAbilityTestMainThreadAction);
|
||
|
}
|
||
|
|
||
|
public testCommunication() {
|
||
|
return this.communicationTest.communicationTest();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const ${workerName}MainTreadWorker = BI.Workers.createWorker(${WorkerName}MainTreadWorker, {
|
||
|
workerUrl,
|
||
|
workerName: BI.UUID(),
|
||
|
});
|
||
|
|
||
|
${workerName}MainTreadWorker.testCommunication()
|
||
|
.then(v => {
|
||
|
console.log(v);
|
||
|
});
|