Documentation ¶
Index ¶
- Constants
- func Delay(sec time.Duration)
- func LaunchServer(addr string, wkb iworkable.Workable)
- type Case
- func (c *Case) Action()
- func (c *Case) GetCluster() string
- func (c *Case) GetDigest() iremote.IDigest
- func (c *Case) HandleMessage(in *message.CardMessage) (*message.CardMessage, error)
- func (c *Case) ReturnByPos(pos int) *card.Card
- func (c *Case) Stamp() *Case
- func (c *Case) Terminate(key string) *Case
- func (c *Case) Update(dgst iremote.IDigest)
- func (c *Case) Validate(in *message.CardMessage, out *message.CardMessage) error
- type Collaborator
- func (clbt *Collaborator) Catchup()
- func (clbt *Collaborator) Clean()
- func (clbt *Collaborator) DelayExecute(t *task.Task) chan *task.Task
- func (clbt *Collaborator) DistributeSeq(sources map[int]*task.Task) (map[int]*task.Task, error)
- func (clbt *Collaborator) Handle(router *mux.Router) *mux.Router
- func (clbt *Collaborator) HandleLocal(router *mux.Router, jobFunc *store.JobFunc)
- func (clbt *Collaborator) HandleShared(router *mux.Router, jobFunc *store.JobFunc)
- func (clbt *Collaborator) Join(wk iworkable.Workable)
- func (clbt *Collaborator) LocalDistribute(pmaps *map[int]*task.Task, stacks []string) error
- func (clbt *Collaborator) SharedDistribute(pmaps *map[int]*task.Task, stacks []string) error
- type Exposed
- type Reserved
- type ServiceClientStub
- type ServiceServerStub
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func LaunchServer ¶
Types ¶
type Case ¶
A central collection of Collaborators across the cluster.
func (*Case) GetCluster ¶
func (*Case) HandleMessage ¶
func (c *Case) HandleMessage(in *message.CardMessage) (*message.CardMessage, error)
func (*Case) Validate ¶
func (c *Case) Validate(in *message.CardMessage, out *message.CardMessage) error
type Collaborator ¶
Collaborator is a helper struct to operate on any inner trxs.
func (*Collaborator) Clean ¶
func (clbt *Collaborator) Clean()
Clean up the case, release terminated servers.
func (*Collaborator) DelayExecute ¶
func (clbt *Collaborator) DelayExecute(t *task.Task) chan *task.Task
Execute the tasks after satisfying some certain conditions.
func (*Collaborator) DistributeSeq ¶
Distribute tasks to peer servers, the tasks will be sequentially sent.
func (*Collaborator) Handle ¶
func (clbt *Collaborator) Handle(router *mux.Router) *mux.Router
Start handling server routes.
func (*Collaborator) HandleLocal ¶
func (clbt *Collaborator) HandleLocal(router *mux.Router, jobFunc *store.JobFunc)
Handle local Job routes.
func (*Collaborator) HandleShared ¶
func (clbt *Collaborator) HandleShared(router *mux.Router, jobFunc *store.JobFunc)
Handle shared Job routes.
func (*Collaborator) Join ¶
func (clbt *Collaborator) Join(wk iworkable.Workable)
Join a master to the collaborator network.
func (*Collaborator) LocalDistribute ¶
The function will process the tasks locally.
func (*Collaborator) SharedDistribute ¶
The function will process the tasks globally within the cluster network.
type Exposed ¶
type Exposed struct { Cards map[string]*card.Card `json:"cards,omitempty"` TimeStamp int64 `json:"timestamp,omitempty"` }
The exposed card addresses.
type Reserved ¶
type Reserved struct { // local is the Card of localhost Local card.Card `json:"local,omitempty"` Coordinator card.Card `json:"coordinator,omitempty"` }
The reserved card addresses.
type ServiceClientStub ¶
type ServiceClientStub struct {
RPCServiceClient
}
func NewServiceClientStub ¶
func NewServiceClientStub(endpoint string, port int32, secure ...bool) (stub *ServiceClientStub, err error)
func (*ServiceClientStub) DistributeAsync ¶
func (*ServiceClientStub) Exchange ¶
func (stub *ServiceClientStub) Exchange(in *message.CardMessage) (*message.CardMessage, error)
type ServiceServerStub ¶
type ServiceServerStub struct {
// contains filtered or unexported fields
}
func NewServiceServerStub ¶
func NewServiceServerStub(wk iworkable.Workable) *ServiceServerStub
func (*ServiceServerStub) Distribute ¶
func (stub *ServiceServerStub) Distribute( ctx context.Context, in *task.TaskPayload) (out *task.TaskPayload, err error)
Local implementation of rpc method Distribute()
func (*ServiceServerStub) Exchange ¶
func (stub *ServiceServerStub) Exchange( ctx context.Context, in *message.CardMessage) (*message.CardMessage, error)
Click to show internal directories.
Click to hide internal directories.