Documentation
¶
Index ¶
- func NewEmbeddedClient(taskchan chan metafora.Task, cmdchan chan *NodeCommand, nodechan chan []string) metafora.Client
- func NewEmbeddedCoordinator(nodeid string, taskchan chan metafora.Task, cmdchan chan *NodeCommand, ...) metafora.Coordinator
- func NewEmbeddedPair(nodeid string) (metafora.Coordinator, metafora.Client)
- func NewStateStore() statemachine.StateStore
- type Commander
- type EmbeddedClient
- type EmbeddedCoordinator
- func (e *EmbeddedCoordinator) Claim(task metafora.Task) bool
- func (e *EmbeddedCoordinator) Close()
- func (e *EmbeddedCoordinator) Command() (metafora.Command, error)
- func (e *EmbeddedCoordinator) Done(task metafora.Task)
- func (e *EmbeddedCoordinator) Init(c metafora.CoordinatorContext) error
- func (e *EmbeddedCoordinator) Name() string
- func (e *EmbeddedCoordinator) Release(task metafora.Task)
- func (e *EmbeddedCoordinator) Watch(out chan<- metafora.Task) error
- type NodeCommand
- type StateChanged
- type StateStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEmbeddedClient ¶
func NewEmbeddedCoordinator ¶
func NewEmbeddedCoordinator(nodeid string, taskchan chan metafora.Task, cmdchan chan *NodeCommand, nodechan chan []string) metafora.Coordinator
func NewEmbeddedPair ¶
func NewEmbeddedPair(nodeid string) (metafora.Coordinator, metafora.Client)
Returns a connected client/coordinator pair for embedded/testing use
func NewStateStore ¶
func NewStateStore() statemachine.StateStore
Types ¶
type Commander ¶
type Commander struct {
// contains filtered or unexported fields
}
Commander is an embedable statemachine.Commander implementation. Task-specific command listeners are created by calling NewListener.
func NewCommander ¶
func NewCommander() *Commander
NewCommander creates a new statemachine.Commander implementation.
func (*Commander) NewListener ¶
func (c *Commander) NewListener(taskID string) statemachine.CommandListener
NewListener creates a task specific command listener linked to an embedded Commander.
type EmbeddedClient ¶
type EmbeddedClient struct {
// contains filtered or unexported fields
}
func (*EmbeddedClient) DeleteTask ¶
func (ec *EmbeddedClient) DeleteTask(taskid string) error
func (*EmbeddedClient) Nodes ¶
func (ec *EmbeddedClient) Nodes() ([]string, error)
func (*EmbeddedClient) SubmitCommand ¶
func (ec *EmbeddedClient) SubmitCommand(nodeid string, command metafora.Command) error
func (*EmbeddedClient) SubmitTask ¶
func (ec *EmbeddedClient) SubmitTask(t metafora.Task) error
type EmbeddedCoordinator ¶
type EmbeddedCoordinator struct {
// contains filtered or unexported fields
}
Coordinator which listens for tasks on a channel
func (*EmbeddedCoordinator) Close ¶
func (e *EmbeddedCoordinator) Close()
func (*EmbeddedCoordinator) Command ¶
func (e *EmbeddedCoordinator) Command() (metafora.Command, error)
func (*EmbeddedCoordinator) Done ¶
func (e *EmbeddedCoordinator) Done(task metafora.Task)
func (*EmbeddedCoordinator) Init ¶
func (e *EmbeddedCoordinator) Init(c metafora.CoordinatorContext) error
func (*EmbeddedCoordinator) Name ¶
func (e *EmbeddedCoordinator) Name() string
func (*EmbeddedCoordinator) Release ¶
func (e *EmbeddedCoordinator) Release(task metafora.Task)
type NodeCommand ¶
type StateChanged ¶
type StateChanged struct {
TaskID string
State *statemachine.State
}
type StateStore ¶
type StateStore struct {
// Stored is intended for tests to block until a Store() is called as an
// alternative to time.Sleep()s.
//
// Will deliver asynchronously and drop states if there's no receivers.
Stored chan StateChanged
// contains filtered or unexported fields
}
StateStore is an in-memory implementation of statemachine.StateStore intended for use in tests.
func (*StateStore) Load ¶
func (s *StateStore) Load(task metafora.Task) (*statemachine.State, error)
func (*StateStore) Store ¶
func (s *StateStore) Store(task metafora.Task, state *statemachine.State) error
Click to show internal directories.
Click to hide internal directories.