Documentation ¶
Index ¶
- func HandleAsLeader(ctx context.Context, nl net.Listener, dp string, cond *sync.Cond, ...)
- func HandleAsWorker(ctx context.Context, addr string, storages []types.Storager)
- type Leader
- func (l *Leader) CreateJob(ctx context.Context, req *models.CreateJobRequest) (reply *models.CreateJobReply, err error)
- func (l *Leader) FinishJob(ctx context.Context, req *models.FinishJobRequest) (reply *models.FinishJobReply, err error)
- func (l *Leader) PollJob(req *models.PollJobRequest, srv models.Worker_PollJobServer) (err error)
- func (l *Leader) Serve(ctx context.Context) (err error)
- func (l *Leader) WaitJob(ctx context.Context, req *models.WaitJobRequest) (reply *models.WaitJobReply, err error)
- type Manager
- func (p *Manager) DB() *models.DB
- func (p *Manager) Elect(ctx context.Context, req *models.ElectRequest) (reply *models.ElectReply, err error)
- func (p *Manager) Finish(ctx context.Context, req *models.FinishRequest) (reply *models.FinishReply, err error)
- func (p *Manager) Poll(req *models.PollRequest, srv models.Staff_PollServer) (err error)
- func (p *Manager) Register(ctx context.Context, req *models.RegisterRequest) (reply *models.RegisterReply, err error)
- func (p *Manager) Stop(ctx context.Context) (err error)
- type ManagerConfig
- type Staff
- type StaffConfig
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleAsLeader ¶
Types ¶
type Leader ¶
type Leader struct { models.UnimplementedWorkerServer // contains filtered or unexported fields }
func (*Leader) CreateJob ¶
func (l *Leader) CreateJob(ctx context.Context, req *models.CreateJobRequest) (reply *models.CreateJobReply, err error)
func (*Leader) FinishJob ¶
func (l *Leader) FinishJob(ctx context.Context, req *models.FinishJobRequest) (reply *models.FinishJobReply, err error)
func (*Leader) PollJob ¶
func (l *Leader) PollJob(req *models.PollJobRequest, srv models.Worker_PollJobServer) (err error)
func (*Leader) WaitJob ¶
func (l *Leader) WaitJob(ctx context.Context, req *models.WaitJobRequest) (reply *models.WaitJobReply, err error)
type Manager ¶
type Manager struct { models.UnimplementedStaffServer // contains filtered or unexported fields }
func NewManager ¶
func NewManager(ctx context.Context, cfg ManagerConfig) (p *Manager, err error)
func (*Manager) Elect ¶
func (p *Manager) Elect(ctx context.Context, req *models.ElectRequest) (reply *models.ElectReply, err error)
func (*Manager) Finish ¶
func (p *Manager) Finish(ctx context.Context, req *models.FinishRequest) (reply *models.FinishReply, err error)
func (*Manager) Poll ¶
func (p *Manager) Poll(req *models.PollRequest, srv models.Staff_PollServer) (err error)
func (*Manager) Register ¶
func (p *Manager) Register(ctx context.Context, req *models.RegisterRequest) (reply *models.RegisterReply, err error)
type ManagerConfig ¶
func (ManagerConfig) GrpcAddr ¶
func (p ManagerConfig) GrpcAddr() string
type Staff ¶
type Staff struct {
// contains filtered or unexported fields
}
func (*Staff) FinishTask ¶
type StaffConfig ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.