Implement weave consense

This commit is contained in:
Adam Harrison committed 2016-03-03 18:52:09 +00:00
1 parent 7c65b6e3bb
commit 6584df274e
5 files changed
+59

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
package ipam
type consense struct {
resultChan chan<- struct{}
}
func (c *consense) Try(alloc *Allocator) bool {
if !alloc.ring.Empty() {
close(c.resultChan)
return true
}
alloc.establishRing()
return false
}
func (c *consense) Cancel() {
close(c.resultChan)
}
func (c *consense) ForContainer(ident string) bool {
return false
}