An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

github.com/thejerf/suture

Package suture provides Erlang-like supervisor trees. This implements Erlang-esque supervisor trees, as adapted for Go. This is an industrial-strength, tested library deployed into hostile environments, not just a proof of concept or a toy. If you are reading this, you are reading the documentation for the v3 version, which is not the latest. If you want the latest v4, be sure to be using github.com/thejerf/suture/v4. This rewrites the API to be in terms of contexts. Supervisor Tree -> SuTree -> suture -> holds your code together when it's trying to fall apart. Why use Suture? Suture has 100% test coverage, and is golint clean. This doesn't prove it free of bugs, but it shows I care. A blog post describing the design decisions is available at http://www.jerf.org/iri/post/2930 . To idiomatically use Suture, create a Supervisor which is your top level "application" supervisor. This will often occur in your program's "main" function. Create "Service"s, which implement the Service interface. .Add() them to your Supervisor. Supervisors are also services, so you can create a tree structure here, depending on the exact combination of restarts you want to create. As a special case, when adding Supervisors to Supervisors, the "sub" supervisor will have the "super" supervisor's Log function copied. This allows you to set one log function on the "top" supervisor, and have it propagate down to all the sub-supervisors. This also allows libraries or modules to provide Supervisors without having to commit their users to a particular logging method. Finally, as what is probably the last line of your main() function, call .Serve() on your top level supervisor. This will start all the services you've defined. See the Example for an example, using a simple service that serves out incrementing integers.

Ecosystem
proxy.golang.org
Latest Release
v4.0.6+incompatible
over 1 year ago
Versions
19
Dependent Packages
32
Dependent Repos
37
Links
Registry proxy.golang.org
Source Repository
Docs Documentation
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:golang/github.com/thejerf/suture
spec
License MIT
Namespace github.com/thejerf
First Release over 10 years ago
Last Synced about 4 hours ago
Repository
Stars 1,377 on GitHub
Forks 74 on GitHub
Docker Dependents 8
Docker Downloads 6,157,230
Commits 114
Committers 16
Avg per Author 7.125
DDS 0.342
Rankings on proxy.golang.org
Overall Top 1.5%
Dependent packages Top 0.9%
Dependent repos Top 0.9%
Forks Top 3.1%
Docker downloads Top 0.4%