Exemplo n.º 1
0
func (p SimplePlacement) RemoveFromLocation(on transport.Locator) bool {
	for _, l := range transport.Locators(p) {
		if l.String() == on.String() {
			return false
		}
	}
	return true
}
Exemplo n.º 2
0
func (p SimplePlacement) Assign(added InstanceRefs, containers Containers) error {
	locators := transport.Locators(p)
	pos := 0
	for i := range added {
		instance := added[i]
		if len(locators) > 0 {
			locator := locators[pos%len(locators)]
			instance.Place(locator)
			pos++
		} else {
			instance.MarkRemoved()
		}
	}
	return nil
}