Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrControllerClosed = errors.New("controller closed")
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold returns a manifold whose worker which wraps a *state.State, which is in turn wrapped by a Tracker. It will exit if the State's associated mongodb session dies.
Types ¶
type ManifoldConfig ¶
type ManifoldConfig struct {
AgentName string
StateConfigWatcherName string
OpenController func(coreagent.Config) (*state.Controller, error)
MongoPingInterval time.Duration
}
ManifoldConfig provides the dependencies for Manifold.
type Tracker ¶
type Tracker interface {
// Use returns wrapped Controller, recording the use of
// it. ErrControllerClosed is returned if the Controller is closed.
Use() (*state.Controller, error)
// Done records that there's one less user of the wrapped Controller,
// closing it if there's no more users. ErrControllerClosed is returned
// if the Controller has already been closed (indicating that Done has
// called too many times).
Done() error
}
Tracker describes a type which wraps and manages the lifetime of a *state.Controller.
Click to show internal directories.
Click to hide internal directories.