Documentation ¶
Overview ¶
Package fetcher implements path segment fetching, verification and combination logic for SCIOND.
Index ¶
Constants ¶
const (
DefaultMinWorkerLifetime = 10 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func NewExtendedContext ¶
func NewExtendedContext(refCtx context.Context, minLifetime time.Duration) (context.Context, context.CancelFunc)
NewExtendedContext returns a new _independent_ context that can extend past refCtx's lifetime, guaranteeing a minimum lifetime of minLifetime. If refCtx has a deadline, the newly created context will have a deadline equal to the maximum of refCtx's deadline and (minLifetime + currentTime). If refCtx does not have a deadline, the function panics.
Because the returned context is independent, calling refCtx's cancellation function will not result in the cancellation of the returned context.
Types ¶
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
func NewFetcher ¶
func (*Fetcher) GetPaths ¶
func (f *Fetcher) GetPaths(ctx context.Context, req *sciond.PathReq, earlyReplyInterval time.Duration) (*sciond.PathReply, error)
GetPaths fulfills the path request described by req. GetPaths will attempt to build paths at start, after earlyReplyInterval and at context expiration (or whenever all background workers return). An earlyReplyInterval of 0 means no early reply attempt is made.