Skip to content

Commit 1d266fc

Browse files
committed
Update RxFlow codegen to use ObservableSink.
1 parent f278c06 commit 1d266fc

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The command line interface to the Bloom compiler is implemented by the
1212
During development, the easiest way to run the compiler is through `sbt run`;
1313
use
1414

15-
sbt run --infile <sourcefile> --target [dataflow|rxflow]
15+
sbt "run --infile <sourcefile> --target [dataflow|rxflow]"
1616

1717
to compile `sourcefile` and generate either a GraphViz .DOT file representing
1818
a dataflow graph (for the `dataflow` target) or Javascript code (for the

compiler/src/main/scala/edu/berkeley/cs/boom/bloomscala/codegen/js/RxFlowCodeGenerator.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ object RxFlowCodeGenerator extends DataflowCodeGenerator with JsCodeGeneratorUti
5050
inputPort.name match {
5151
case "deltaIn" => ".insert"
5252
}
53-
case OutputElement(collection) =>
54-
empty // Since outputs are currently implemented as RxJs Sbjects.
5553
case _ => ".input"
5654
})
5755
}
@@ -94,15 +92,14 @@ object RxFlowCodeGenerator extends DataflowCodeGenerator with JsCodeGeneratorUti
9492
}
9593

9694
private def buildOutputs(graph: DataflowGraph): Doc = {
97-
// TODO: this should create an Rx observable, not a Subject.
9895
val outputs = graph.outputs.values.map { output =>
99-
(elemName(output), "new" <+> methodCall("rx", "Subject") <+>
96+
(elemName(output), "new" <+> methodCall("rxflow", "ObservableSink") <+>
10097
comment(BloomPrettyPrinter.pretty(output.collection)))
10198
}.toMap
10299

103100
"var" <+> "outputs" <+> equal <+> mapLiteral(outputs) <> semi <@@>
104101
graph.outputs.values.map { output =>
105-
"this" <> dot <> output.collection.name <+> equal <+> elemRef(output) <> semi
102+
"this" <> dot <> output.collection.name <+> equal <+> elemRef(output) <> dot <> "output" <> semi
106103
}.foldLeft(empty)(_ <@@> _)
107104
}
108105

0 commit comments

Comments
 (0)