Simple frame for node graph inspired task processing.
-
Each individual flow can be executed concurrently on separate goroutines.
-
At node level, all nodes of an individual graph should execute on the same goroutine (synchronous).
My intended purpose is to use this with https://github.com/WolvenSpirit/postgres-queue but it is just a few lines of code to provide a frame or example for any sort of node based separation of steps that together can define a task flow.
Main reasons:
✅ Handle errors consistently.
✅ Handle program conditional logic flows consistently.
✅ Have a recorded and traceable logic flow throughout task execution.
✅ Now makes full use of Go Generics (go 1.18)
✅ Provides optional onFinished hook on each node. No matter if the node fails or succeeds, a custom clean-up function can run that might perform additional checks or store metrics regarding the outcome.
Examples for using this package can be found in the examples folder.