https://github.com/cirello-io/oversight
Erlang-like supervisor trees
https://github.com/cirello-io/oversight
erlang go golang oversight supervisor
Last synced: 20 days ago
JSON representation
Erlang-like supervisor trees
- Host: GitHub
- URL: https://github.com/cirello-io/oversight
- Owner: cirello-io
- License: apache-2.0
- Created: 2018-11-09T14:46:48.000Z (over 6 years ago)
- Default Branch: v2
- Last Pushed: 2025-03-01T18:39:02.000Z (about 2 months ago)
- Last Synced: 2025-03-24T05:26:20.932Z (about 1 month ago)
- Topics: erlang, go, golang, oversight, supervisor
- Language: Go
- Homepage: https://cirello.io/oversight/v2
- Size: 227 KB
- Stars: 32
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - cirello-io/oversight - Erlang-like supervisor trees (Go)
- awesome-go-extra - oversight - like supervisor trees|28|5|0|2018-11-09T14:46:48Z|2022-01-17T06:16:42Z| (Goroutines / Advanced Console UIs)
README
# cirello.io/oversight/v2
[](https://pkg.go.dev/cirello.io/oversight/v2)
Package oversight mimics the implementation of Erlang supervision trees.
Refer to: http://erlang.org/doc/design_principles/sup_princ.html
go get cirello.io/oversight/v2
https://pkg.go.dev/cirello.io/oversight/v2
## Quickstart
```
var tree oversight.Tree
err := tree.Add(
func(ctx context.Context) error {
select {
case <-ctx.Done():
return nil
case <-time.After(time.Second):
fmt.Println(1)
}
return nil
},
oversight.Permanent(),
oversight.Natural(),
"childProcess",
)
if err != nil {
log.Fatal(err)
}
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
fmt.Println(tree.Start(ctx))
```