Comparing version 0.0.1-beta.4 to 0.0.1-beta.5
@@ -15,2 +15,3 @@ "use strict"; | ||
const assert_1 = require("assert"); | ||
const stats_1 = require("../../stats"); | ||
const DEFAULT_BATCH_TIMEOUT_SEC = 0.2; | ||
@@ -73,2 +74,22 @@ /** | ||
/** | ||
* | ||
* @param boxNames names of the boxes in the flow | ||
* @param boxBMeta building metainformation collected while building the DAG | ||
* @param schema the definition of the schema, to identify "source" of the event | ||
*/ | ||
//TODO: extract into EEmiter of the flow itself | ||
// when emitting from stats EE, we can't distinguish events of various flows | ||
function emitFlowSchema(boxNames, boxBMeta, graph, schema) { | ||
const edges = graph.inEdges(); | ||
const boxMetas = boxNames.reduce((metas, name) => { | ||
if (boxBMeta[name].instance) { | ||
const meta = boxBMeta[name].instance.meta; | ||
metas[name] = meta; | ||
} | ||
return metas; | ||
}, {}); | ||
stats_1.eventEmitter.emit('flowSchema', schema, boxMetas, edges); | ||
return; | ||
} | ||
/** | ||
* Builder that connects the boxes into directed acyclic graph based on their dependences. | ||
@@ -117,2 +138,3 @@ * TODO: (idea2) use some logical/analytical language (SWI Prolog?), don't even figure the instantiation order of the | ||
if (boxName === '_root_') { | ||
emitFlowSchema(boxBuildOrder, boxMeta, graph, schema); | ||
if (depsQueues.length == 1) { | ||
@@ -119,0 +141,0 @@ return depsQueues[0]; |
@@ -95,4 +95,7 @@ "use strict"; | ||
runFlow(flow, jobInitialValue) { | ||
const job = new Job_1.Job(jobInitialValue); | ||
console.log('Program run ----->'); | ||
flow.process(new Job_1.Job(jobInitialValue)); | ||
// TODO: separate this from stats EE -- it is shared accross various flows | ||
stats_1.eventEmitter.emit('run', flow, job); | ||
flow.process(job); | ||
// setTimeout(() => flow.process(new Job()),2000); | ||
@@ -99,0 +102,0 @@ } |
@@ -15,2 +15,3 @@ "use strict"; | ||
const assert_1 = require("assert"); | ||
const stats_1 = require("../../stats"); | ||
const DEFAULT_BATCH_TIMEOUT_SEC = 0.2; | ||
@@ -73,2 +74,22 @@ /** | ||
/** | ||
* | ||
* @param boxNames names of the boxes in the flow | ||
* @param boxBMeta building metainformation collected while building the DAG | ||
* @param schema the definition of the schema, to identify "source" of the event | ||
*/ | ||
//TODO: extract into EEmiter of the flow itself | ||
// when emitting from stats EE, we can't distinguish events of various flows | ||
function emitFlowSchema(boxNames, boxBMeta, graph, schema) { | ||
const edges = graph.inEdges(); | ||
const boxMetas = boxNames.reduce((metas, name) => { | ||
if (boxBMeta[name].instance) { | ||
const meta = boxBMeta[name].instance.meta; | ||
metas[name] = meta; | ||
} | ||
return metas; | ||
}, {}); | ||
stats_1.eventEmitter.emit('flowSchema', schema, boxMetas, edges); | ||
return; | ||
} | ||
/** | ||
* Builder that connects the boxes into directed acyclic graph based on their dependences. | ||
@@ -117,2 +138,3 @@ * TODO: (idea2) use some logical/analytical language (SWI Prolog?), don't even figure the instantiation order of the | ||
if (boxName === '_root_') { | ||
emitFlowSchema(boxBuildOrder, boxMeta, graph, schema); | ||
if (depsQueues.length == 1) { | ||
@@ -119,0 +141,0 @@ return depsQueues[0]; |
@@ -95,4 +95,7 @@ "use strict"; | ||
runFlow(flow, jobInitialValue) { | ||
const job = new Job_1.Job(jobInitialValue); | ||
console.log('Program run ----->'); | ||
flow.process(new Job_1.Job(jobInitialValue)); | ||
// TODO: separate this from stats EE -- it is shared accross various flows | ||
stats_1.eventEmitter.emit('run', flow, job); | ||
flow.process(job); | ||
// setTimeout(() => flow.process(new Job()),2000); | ||
@@ -99,0 +102,0 @@ } |
{ | ||
"name": "bakeryjs", | ||
"version": "0.0.1-beta.4", | ||
"version": "0.0.1-beta.5", | ||
"description": "FBP-inspired library", | ||
@@ -5,0 +5,0 @@ "main": "build/index", |
@@ -65,4 +65,8 @@ # ![BakeryJS](assets/logo.png) | ||
## Resources | ||
- Article [Bake Your Data With BakeryJS](https://medium.com/socialbakers-engineering/bake-your-data-with-bakeryjs-3a7636cfff82) | ||
## License | ||
MIT |
Sorry, the diff of this file is not supported yet
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
416138
250
7177
72
1