Skip to content

Commit

Permalink
added push example
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-higgins committed May 11, 2024
1 parent f9ab85d commit 0049d12
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.fluxtion.example.reference.dsl;

import com.fluxtion.compiler.Fluxtion;
import com.fluxtion.compiler.builder.dataflow.DataFlow;

public class PushSample {
public static void main(String[] args) {
var processor = Fluxtion.interpret(c ->
DataFlow.subscribe(String.class)
.push(new MyPushTarget()::updated)
);
processor.init();

processor.onEvent("AAA");
processor.onEvent("BBB");
}

public static class MyPushTarget{
public void updated(String in){
System.out.println("received push: " + in);
}
}
}

0 comments on commit 0049d12

Please sign in to comment.