Implement weave consense
This commit is contained in:
1 parent
7c65b6e3bb
commit
6584df274e
5 files changed
+59
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user