func (alloc *Allocator) Allocate(ident string, r address.CIDR, isContainer bool, hasBeenCancelled func() bool) (address.Address, error) {
	resultChan := make(chan allocateResult)
	op := &allocate{
		resultChan:       resultChan,
		ident:            ident,
		r:                r,
		isContainer:      isContainer,
		hasBeenCancelled: hasBeenCancelled,
	}
	alloc.doOperation(op, &alloc.pendingAllocates)
	result := <-resultChan
	return result.addr, result.err
}
// Allocate (Sync) - get new IP address for container with given name in range
// if there isn't any space in that range we block indefinitely
Allocate (Sync) - get new IP address for container with given name in range
if there isn't any space in that range we block indefinitely
// Allocate ( Sync ) - get new IP address for container with given name in range // if there isn ' t any space in that range we block indefinitely
func (alloc *Allocator) Allocate(ident string, r address.CIDR, isContainer bool, hasBeenCancelled func() bool) (address.Address, error) {
	resultChan := make(chan allocateResult)
	op := &allocate{
		resultChan:       resultChan,
		ident:            ident,
		r:                r,
		isContainer:      isContainer,
		hasBeenCancelled: hasBeenCancelled,
	}
	alloc.doOperation(op, &alloc.pendingAllocates)
	result := <-resultChan
	return result.addr, result.err
}
func ( alloc * Allocator ) Allocate ( ident string , r address . CIDR , isContainer bool , hasBeenCancelled func ( ) bool ) ( address . Address , error ) { resultChan := make ( chan allocateResult ) op := & allocate { resultChan : resultChan , ident : ident , r : r , isContainer : isContainer , hasBeenCancelled : hasBeenCancelled , } alloc . doOperation ( op , & alloc . pendingAllocates ) result := <- resultChan return result . addr , result . err }
Allocate (Sync) - get new IP address for container with given name in range
if there isn't any space in that range we block indefinitely
Allocate ( Sync ) - get new IP address for container with given name in range if there isn ' t any space in that range we block indefinitely