Skip to content

Commit

Permalink
library examples
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-higgins committed Apr 28, 2024
1 parent 4160b5f commit 244dfe5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ public static void main(String[] args) {
var processor = Fluxtion.interpret(cfg ->
DataFlow.subscribeToIntSignal("myIntSignal")
.mapToObj(d -> "intValue:" + d)
.sink("mySink"));
.sink("mySink")//CREATE A SINK IN THE PROCESSOR
);
processor.init();

//ADDING A SINK
processor.addSink("mySink", (Consumer<String>) System.out::println);

processor.publishSignal("myIntSignal", 10);
processor.publishSignal("myIntSignal", 256);

//REMOVING A SINK
processor.removeSink("mySink");
processor.publishSignal("myIntSignal", 512);
}
Expand Down

0 comments on commit 244dfe5

Please sign in to comment.