Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrStateClosed = errors.New("state 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 wrapper by a StateTracker. It will exit if the State's associated mongodb session dies.
Types ¶
type ManifoldConfig ¶
type ManifoldConfig struct {
AgentName string
StateConfigWatcherName string
OpenState func(coreagent.Config) (*state.State, error)
PingInterval time.Duration
}
ManifoldConfig provides the dependencies for Manifold.
type StateTracker ¶
type StateTracker interface {
// Use returns wrapped State, recording the use of
// it. ErrStateClosed is returned if the State is closed.
Use() (*state.State, error)
// Done records that there's one less user of the wrapped State,
// closing it if there's no more users. ErrStateClosed is returned
// if the State has already been closed (indicating that Done has
// called too many times).
Done() error
}
StateTracker describes a type which wraps and manages the lifetime of a *state.State.
Click to show internal directories.
Click to hide internal directories.