orchestrator

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrIncompleteGraph is returned when a requested graph is incomplete
	ErrIncompleteGraph = errors.Error("incomplete graph")
)

Variables

This section is empty.

Functions

func IsComplete

func IsComplete(cs []object.Object) bool

IsComplete checks if a graph is missing any nodes

Types

type Graph

type Graph struct {
	Objects []object.Object
}

type Orchestrator

type Orchestrator interface {
	Sync(
		ctx context.Context,
		stream object.Hash,
		recipients peer.LookupOption,
		options ...exchange.Option,
	) (*Graph, error)
	Put(object.Object) error
	Get(
		ctx context.Context,
		root object.Hash,
	) (*Graph, error)
}

Orchestrator is responsible of keeping streams and their underlying graphs up to date

func New

New constructs a new orchestrator given an object store and exchange

func NewWithContext

NewWithContext constructs a new orchestrator given an object store and exchange

type Queue

type Queue interface {
	Enqueue(key string, work WorkFunc) error
}

Queue -

func NewQueue

func NewQueue(ctx context.Context, workers int) Queue

NewQueue constructs a new queue

type WorkFunc

type WorkFunc func() error

WorkFunc defines work that must be completed

Jump to

Keyboard shortcuts

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