embedded

package
v0.0.0-...-eab3a14 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

README

Creates client/coordinator pairs which use channels to communicate.

Meant to be used embedded in applications which do not need/want external coordination, especially tests.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEmbeddedClient

func NewEmbeddedClient(taskchan chan string, cmdchan chan *NodeCommand, nodechan chan []string) metafora.Client

func NewEmbeddedCoordinator

func NewEmbeddedCoordinator(nodeid string, taskchan chan string, 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

Types

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(taskid string) error

type EmbeddedCoordinator

type EmbeddedCoordinator struct {
	// contains filtered or unexported fields
}

Coordinator which listens for tasks on a channel

func (*EmbeddedCoordinator) Claim

func (e *EmbeddedCoordinator) Claim(taskID string) bool

func (*EmbeddedCoordinator) Close

func (e *EmbeddedCoordinator) Close()

func (*EmbeddedCoordinator) Command

func (e *EmbeddedCoordinator) Command() (metafora.Command, error)

func (*EmbeddedCoordinator) Done

func (e *EmbeddedCoordinator) Done(taskID string)

func (*EmbeddedCoordinator) Init

func (*EmbeddedCoordinator) Release

func (e *EmbeddedCoordinator) Release(taskID string)

func (*EmbeddedCoordinator) Watch

func (e *EmbeddedCoordinator) Watch() (taskID string, err error)

type NodeCommand

type NodeCommand struct {
	Cmd    metafora.Command
	NodeId string
}

Jump to

Keyboard shortcuts

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