fable 3.0.100 → 3.0.102
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/dist/fable.compatible.js +4 -2
- package/dist/fable.compatible.min.js +1 -1
- package/dist/fable.compatible.min.js.map +1 -1
- package/dist/fable.js +4 -2
- package/dist/fable.min.js +1 -1
- package/dist/fable.min.js.map +1 -1
- package/package.json +1 -1
- package/source/services/Fable-Service-Anticipate.js +2 -2
package/dist/fable.js
CHANGED
|
@@ -2875,9 +2875,11 @@ if(this.servicesMap[pServiceType].hasOwnProperty(pServiceHash)){if(!this.hasOwnP
|
|
|
2875
2875
|
function autoConstruct(pSettings){return new Fable(pSettings);}module.exports=Fable;module.exports.new=autoConstruct;module.exports.LogProviderBase=libFableLog.LogProviderBase;module.exports.ServiceProviderBase=libFableServiceBase;module.exports.CoreServiceProviderBase=libFableServiceBase.CoreServiceProviderBase;module.exports.precedent=libFableSettings.precedent;},{"./services/Fable-Service-Anticipate.js":120,"./services/Fable-Service-CSVParser.js":121,"./services/Fable-Service-DataFormat.js":122,"./services/Fable-Service-DataGeneration.js":124,"./services/Fable-Service-DateManipulation.js":125,"./services/Fable-Service-EnvironmentData.js":126,"./services/Fable-Service-FilePersistence.js":127,"./services/Fable-Service-MetaTemplate.js":128,"./services/Fable-Service-Operation.js":132,"./services/Fable-Service-RestClient.js":133,"./services/Fable-Service-Template.js":134,"./services/Fable-Service-Utility.js":135,"cachetrax":22,"fable-log":43,"fable-serviceproviderbase":44,"fable-settings":47,"fable-uuid":49,"manyfest":72}],120:[function(require,module,exports){const libFableServiceBase=require('fable-serviceproviderbase');class FableServiceAnticipate extends libFableServiceBase{constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);this.serviceType='AsyncAnticipate';// The queue of operations waiting to run.
|
|
2876
2876
|
this.operationQueue=[];this.erroredOperations=[];this.executingOperationCount=0;this.completedOperationCount=0;this.maxOperations=1;this.lastError=undefined;this.waitingFunctions=[];}checkQueue(){// This checks to see if we need to start any operations.
|
|
2877
2877
|
if(this.operationQueue.length>0&&this.executingOperationCount<this.maxOperations){let tmpOperation=this.operationQueue.shift();this.executingOperationCount+=1;tmpOperation(this.buildAnticipatorCallback());}else if(this.waitingFunctions.length>0&&this.executingOperationCount<1){// If there are no operations left, and we have waiting functions, call them.
|
|
2878
|
-
for(let i=0;i<this.waitingFunctions.length;i++){this.log.trace('Calling waiting function.')
|
|
2878
|
+
for(let i=0;i<this.waitingFunctions.length;i++){//this.log.trace('Calling waiting function.')
|
|
2879
|
+
this.waitingFunctions[i](this.lastError);}// Reset our state
|
|
2879
2880
|
this.lastError=undefined;this.waitingFunctions=[];}}// Expects a function fAsynchronousFunction(fCallback)
|
|
2880
|
-
anticipate(fAsynchronousFunction){this.log.trace('Adding a function...')
|
|
2881
|
+
anticipate(fAsynchronousFunction){//this.log.trace('Adding a function...')
|
|
2882
|
+
this.operationQueue.push(fAsynchronousFunction);this.checkQueue();}buildAnticipatorCallback(){// This uses closure-scoped state to track the callback state
|
|
2881
2883
|
let tmpCallbackState={Called:false,Error:undefined,OperationSet:this};return hoistedCallback;function hoistedCallback(pError){if(tmpCallbackState.Called){// If they call the callback twice, throw an error
|
|
2882
2884
|
throw new Error("Anticipation async callback called twice...");}tmpCallbackState.Called=true;tmpCallbackState.error=pError;tmpCallbackState.OperationSet.executingOperationCount-=1;tmpCallbackState.OperationSet.completedOperationCount+=1;tmpCallbackState.OperationSet.checkQueue();}}wait(fCallback){this.waitingFunctions.push(fCallback);this.checkQueue();}}module.exports=FableServiceAnticipate;},{"fable-serviceproviderbase":44}],121:[function(require,module,exports){const libFableServiceProviderBase=require('fable-serviceproviderbase');/**
|
|
2883
2885
|
* Parsing CSVs. Why? Because it's a thing that needs to be done.
|