找回密码
 立即注册
搜索
热搜: 丝袜 魅魔 黑丝
查看: 7|回复: 0

16257901_第十二章

[复制链接]

13万

主题

343

回帖

22万

积分

管理员

站长

UID
1
积分
224400
余额
13 R
Moe币
84881
在线时间
279 小时
注册时间
2025-12-28
最后登录
2026-11-9
发表于 2026-9-3 23:00:59 | 显示全部楼层 |阅读模式
nyTask=function(){var e=new t(!0);return e.pTask=this.curTask,this.curTask.beginTinyTask(e),e},t.prototype.endTinyTask=function(){return this.pTask.endTinyTask(this.curTask)},t.prototype.beginBatchTask=function(){return this.level+=1,this.token=u(),this},t.prototype.endBatchTask=function(){this.level-=1},t.prototype.start=function(){if(this.curTask){var e=this.curTask.getJobList();e.length>0&&this.runJobs(e)}},t.prototype.runJobs=function(e){this.jobList=e,this.waitList=(0,a.fX)([],e,!0),this.startRun()},t.prototype.parseTask=function(e,t){this.isInParsingTask=!0;var n=e(t);return n&&n.isTask&&(n.token=e.token,n.level=e.level,n.pExecutor=this),this.isInParsingTask=!1,n},t.prototype.runFinallyTask=function(e){if(this.finallyTask){var t=this.parseTask(this.finallyTask,e);t&&t.isTask&&(this.loadTask(t),this.start()),this.finallyTask=null}},t.prototype.runPenddingTasks=function(e){if(!(this.penddingTasks.length<=0)){var t=this.penddingTasks[0],n=this.parseTask(t,e);if(this.resovledTasks.push(this.penddingTasks[0]),this.penddingTasks.splice(0,1),!n||!n.isTask)return this.resetCurTask(),this.runPenddingTasks(null);this.loadTask(n),this.start()}},t.prototype.clearPenddingTasks=function(){for(var e=0;e<this.penddingTasks.length;++e){var t=this.penddingTasks[e],n=t.token,r=t.level;n===this.curTask.token&&r===this.curTask.level&&this.penddingTasks.splice(e--,1)}},t.prototype.resetCurTask=function(){this._isRunning=!1,this.processingList=[],this.waitList=[],this.jobList=[]},t.prototype.clearTasks=function(){this._isRunning=!1,this.processingList=[],this.waitList=[],this.jobList=[],this.resovledTasks=[],this.clearPenddingTasks()},t.prototype.loadTask=function(e){e.isTask&&(this.curTask=e)},t.prototype.run=function(e){if(e.level=this.level,e.token=this.token,this._isRunning||this.isInParsingTask)this.penddingTasks.push(e);else{var t=this.parseTask(e,null);if(!t||!t.isTask)return this;this.loadTask(t),this.start()}return this},t.prototype.then=function(e){return this.run(e)},t.prototype.addTask=function(e){return this.run(e)},t.prototype.finally=function(e){this.finallyTask?console.error("only support one finally task!"):this.finallyTask=e},t.prototype.hasFinally=function(){return!!this.finallyTask},t.prototype.getProgress=function(){var e=this.resovledTasks.length+this.penddingTasks.length,t=(this.resovledTasks.length-1)/e,n=this.processingList.length/this.jobList.length;return t+100/e*(this.processingList.length/n)},t}(s.A),p="task_finish",d="task_error",f="task_cancel",g="task_cancel_fail",h=function(){function e(e){var t=this;this.jobList=[],this.concurrentCount=1,this.childExecutors=[],this.outResult={},this._state=c.D.None,this.level=0,this.isActiveMainTask=function(){return!t.pExecutor.isTiny&&t.pExecutor.curTask===t},this.cancelTask=function(){t.pExecutor.cancel()},this.tag=e}return Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(e){this.isFinish?console.error(this.tag," Task is finish, can not change state"):this._state!==e?(this._state=e,this.outResult.state=e,this.onStateChange(this._state)):console.warn(this.tag," Task state is same, can not change state")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTask",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isFinish",{get:function(){return this.state!==c.D.None},enumerable:!1,configurable:!0}),e.prototype.getParentTask=function(){return this.pExecutor&&this.pExecutor.pTask},e.prototype.beginTinyTask=function(e){return e||((e=new l).pTask=this),this.childExecutors.push(e),e},e.prototype.endTinyTask=function(e){if(e)for(var t=this.childExecutors,n=0;n<t.length;++n){t[n].getToken()===(null==e?void 0:e.token)&&t.splice(n--,1)}else this.childExecutors=[]},e.prototype.getTag=function(){return this.tag},e.prototype.setTag=function(e){this.tag=e},e.prototype.getResult=function(){return this.errorInfo&&(this.outResult.errorInfo=this.errorInfo),this.outResult},e.prototype.setResult=function(e){this.outResult=e},e.prototype.getErrorInfo=function(){return this.errorInfo},e.prototype.setErrorInfo=function(e){e.tag||(e.tag=this.tag),this.errorInfo=e},e.prototype.setConcurrentCount=function(e){this.concurrentCount=e},e.prototype.getConcurrentCount=function(){return this.concurrentCount},e.prototype.getJobList=function(){return this.jobList},e.prototype.setJobList=function(e){this.jobList=e},e.prototype.jobHandler=function(e){return(0,a.sH)(this,void 0,void 0,(function(){return(0,a.YH)(this,(function(e){throw new Error("Interface, Not implement!")}))}))},e.prototype.onStop=function(e){throw new Error("Interface, Not implement!")},e.prototype.onCancel=function(e){throw new Error("Interface, Not implement!")},e.prototype.onComplete=function(e){throw new Error("Interface, Not implement!")},e.prototype.onError=function(e,t){throw new Error("Interface, Not implement!")},e.prototype.onCancelFailed=function(){this.pExecutor.fire(g,{tag:this.tag})},e.prototype.onStateChange=function(e){switch(e){case c.D.isCancel:this.pExecutor.fire(f,{tag:this.tag});break;case c.D.isError:this.pExecutor.fire(d,{tag:this.tag});break;case c.D.isFinish:this.pExecutor.fire(p,{tag:this.tag})}},e.prototype.cancelChildExector=function(){var e=(0,a.fX)([],this.childExecutors,!0);e.length<1||e.forEach((function(e){e.cancel()}))},e}(),v=function(){function e(e){var t=this;this.tasks={},null==e||e.forEach((function(e){t.register(e.tag,e.TaskClass)}))}return e.prototype.registerAll=function(){throw new Error("Interface, Not implement!")},e.prototype.getTask=function(e,t){return new(0,this.tasks[e])(t)},e.prototype.register=function(e,t){this.tasks[e]=t},e}();!function(e){e.top="top",e.generateSingleNote="generateSingleNote",e.generateAllPageNote="generateAllPageNote",e.streamOutputText="streamOutputText"}(o||(o={}));var m=n(41026),w=n(27589),A=n(82805),E=n(12019),y=n(70238),b=n(6636),T=n(42532),_=n(96080),k=n(4051),x=n(61937),C=n(34115),I=n(38778),S=n(5521),N=n(4914),P=n(38163),R=n(59677),D=n(77944),H=b.EH.config.concurrentGenerateCount||6,j=function(){return N.A.generate.empty},O=function(e){function t(t){var n=e.call(this,o.generateSingleNote)||this;return n.setTrackInfo=function(e){n.trackI
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|M男之家

GMT+8, 2026-11-9 21:58 , Processed in 0.047018 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表