Skip to content

Instantly share code, notes, and snippets.

View hovsep's full-sized avatar
🤓
Constant learner

Ovsep Avakian hovsep

🤓
Constant learner
  • SumUp
  • Sofia, Bulgaria
View GitHub Profile
@hovsep
hovsep / goflow_example.go
Created January 8, 2026 07:53
goflow example
package main
import (
"fmt"
"github.com/trustmaster/goflow"
)
// Greeter sends greetings
type Greeter struct {
Name <-chan string // input port
@hovsep
hovsep / results_extraction.go
Created January 8, 2026 07:50
fmesh results extraction example
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),
)
@hovsep
hovsep / activation_func.go
Created January 8, 2026 07:26
FMesh component activation function example
func(this *component.Component) error {
num := this.InputByName("num").Signals().FirstPayloadOrDefault(0) // Read inputs
this.OutputByName("res").PutSignals(signal.New(num.(int) * 3)) // Provide outputs
return nil // Report possible errors
}