Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A library for building clustered services in Go
Go
Branch: master
Failed to load latest commit information.
donutctl Use dforsyth/sprinkles zookeeper wrapper, update some terminology, ad…
example
README.md
TODO Use dforsyth/sprinkles zookeeper wrapper, update some terminology, ad…
balancer.go Use dforsyth/sprinkles zookeeper wrapper, update some terminology, ad…
cluster.go bits of cleanup
listener.go
util.go Use dforsyth/sprinkles zookeeper wrapper, update some terminology, ad…

README.md

Donut is a library for building clustered services in Go. It was originally modeled after Ordasity (http://github.com/boundary/ordasity).

Example Service

package main

import (
    "github.com/dforsyth/donut"
    "github.com/dforsyth/sprinkles/zookeeper"
    "log"
)

type ExampleListener struct{}

func (*ExampleListener) OnJoin(zk *zookeeper.ZooKeeper) {
    log.Println("Joined the cluster!")
}

func (*ExampleListener) StartTask(taskId string) {}

func (*ExampleListener) EndTask(taskId string) {}

func (*ExampleListener) OnLeave() {}

func main() {
    config := donut.NewConfig()
    config.Servers = []string{"localhost:2181"}
    config.NodeId = "node"
    c := donut.NewCluster("example", config, &donut.DumbBalancer{}, &ExampleListener{})
    c.Join()
    select {}
}

Documentation

http://go.pkgdoc.org/github.com/dforsyth/donut

Something went wrong with that request. Please try again.