Created
January 8, 2026 07:50
-
-
Save hovsep/3618456fe6b37239492a99f85b646f1b to your computer and use it in GitHub Desktop.
fmesh results extraction example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func main() { | |
| // Build mesh | |
| numbersCruncher := getMesh() | |
| // Init with data | |
| numbersCruncher.ComponentByName("first-stage").InputByName("num").PutSignals( | |
| signal.New(1), | |
| signal.New(2), | |
| signal.New(3), | |
| ) | |
| // Run | |
| _, err := numbersCruncher.Run() | |
| if err != nil { | |
| fmt.Println("FMesh finished with error:", err) | |
| os.Exit(1) | |
| } | |
| // Extract results | |
| results := numbersCruncher.ComponentByName("last-stage").OutputByName("res").Signals() | |
| fmt.Println("FMesh finished successfully") | |
| fmt.Println("Results:") | |
| results.ForEach(func(sig *signal.Signal) error { | |
| fmt.Println(sig.PayloadOrDefault("no payload")) | |
| return nil | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment