zonecut

package
v0.0.0-...-3d855e8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2018 License: BSD-2-Clause Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const REQ_CHAN_CAPACITY = 10

REQ_CHAN_CAPACITY is the capacity of the channel into which are submitted new requests. This is used as a back off mechanism if the submitter is much faster than the finder.

View Source
const WORKER_CHAN_CAPACITY = 10

WORKER_CHAN_CAPACITY is the maximum number of unhandled requests that may be to the worker, before a call to handle() is blocking.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finder

type Finder struct {
	// contains filtered or unexported fields
}

Finder is a worker pool maintainer for the retrieval of zone cuts/delegation information of requested zones.

func NewFinder

func NewFinder(nrHandler func(*nameresolver.Request) *errors.ErrorStack, conf *tools.TransdepConfig) *Finder
NewFinder builds a new Finder instance and starts the associated goroutine for request handling.

nrHandler is the function to call to submit new name resolution requests

maxWorkerCount is the maximum number of simultaneously live zone cut workers. Once this number is reached, the least recently used worker is shut down and a new worker is started to handle the new request.

cacheRootDir is the root directory for caching

rootHints is the name of the file from which the root hints should be loaded.

func (*Finder) Handle

func (z *Finder) Handle(req *zonecut.Request) *errors.ErrorStack

Handle is the method to call to submit new zone cut/delegation information discovery requests. An error might be returned if this finder is already stopping.

func (*Finder) Stop

func (z *Finder) Stop() bool

Stop signals that no new requests will be submitted. It triggers some cleanup of the remaining live workers, wait for them to finish and then returns true. Subsequent calls to Stop will return false as the finder is already stopped.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL