Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NewResumer = func(config Config) (*Resumer, error) { if err := config.Validate(); err != nil { return nil, errors.Trace(err) } rr := &Resumer{config: config} err := catacomb.Invoke(catacomb.Plan{ Site: &rr.catacomb, Work: rr.loop, }) if err != nil { return nil, errors.Trace(err) } return rr, nil }
NewResumer returns a new Resumer or an error. If the Resumer is not nil, the caller is responsible for stopping it via `Kill()` and handling any error returned from `Wait()`.
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold returns a dependency manifold that runs a resumer worker, using the resources named or defined in the supplied config.
Types ¶
type Facade ¶
type Facade interface {
// ResumeTransactions resumes all pending transactions.
ResumeTransactions() error
}
Facade defines the interface for types capable of resuming transactions.
type ManifoldConfig ¶
type ManifoldConfig struct {
AgentName string
APICallerName string
Clock clock.Clock
Interval time.Duration
NewFacade func(base.APICaller) (Facade, error)
NewWorker func(Config) (worker.Worker, error)
}
ManifoldConfig defines the names of the manifolds on which a Manifold will depend.
Click to show internal directories.
Click to hide internal directories.