Documentation ¶
Index ¶
- type IterationResult
- type Leader
- type MandelIteration
- type NodeServiceGrpcServer
- func (n NodeServiceGrpcServer) AssignTask(request *pb.Request, server pb.NodeService_AssignTaskServer) error
- func (n NodeServiceGrpcServer) ReportResult(ctx context.Context, result *pb.WorkResponse) (*pb.Response, error)
- func (n NodeServiceGrpcServer) ReportStatus(ctx context.Context, request *pb.Request) (*pb.Response, error)
- type WorkerNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IterationResult ¶
type Leader ¶
type Leader struct {
// contains filtered or unexported fields
}
Leader node instance type
func GetLeader ¶
func GetLeader( host string, colorStep int, width int, height int, xPos float64, yPos float64, escapeRadius float64, smoothness int, iters int, palette string, outfile string, forceExit, quiet, metrics bool, ) (*Leader, error)
GetLeader returns the leader node instance
func (*Leader) RenderDistributed ¶
RenderDistributed sends work to the worker channel
type MandelIteration ¶
type MandelIteration struct { Xmin float64 Ymin float64 Xmax float64 Ymax float64 IndexY int Width int MaxIteration int }
A mandel iteration holds values that a worker needs to calculate a single pixel value
type NodeServiceGrpcServer ¶
type NodeServiceGrpcServer struct { pb.UnimplementedNodeServiceServer ResultChannel chan IterationResult WorkChannel chan MandelIteration }
func GetNodeServiceGrpcServer ¶
func GetNodeServiceGrpcServer() *NodeServiceGrpcServer
GetNodeServiceGrpcServer singleton service
func (NodeServiceGrpcServer) AssignTask ¶
func (n NodeServiceGrpcServer) AssignTask(request *pb.Request, server pb.NodeService_AssignTaskServer) error
func (NodeServiceGrpcServer) ReportResult ¶
func (n NodeServiceGrpcServer) ReportResult(ctx context.Context, result *pb.WorkResponse) (*pb.Response, error)
Report a result to the leader
func (NodeServiceGrpcServer) ReportStatus ¶
func (n NodeServiceGrpcServer) ReportStatus(ctx context.Context, request *pb.Request) (*pb.Response, error)
ReportStatus reports a worker status Assume it's at the start of a run and we set reporting of metrics back to false
type WorkerNode ¶
type WorkerNode struct {
// contains filtered or unexported fields
}
func GetWorkerNode ¶
func GetWorkerNode(host string, retries int, quiet bool) *WorkerNode
func (*WorkerNode) ConnectStream ¶
func (n *WorkerNode) ConnectStream() (pb.NodeService_AssignTaskClient, error)
Connect to the stream with some backoff
func (*WorkerNode) Init ¶
func (n *WorkerNode) Init() (err error)
func (*WorkerNode) Start ¶
func (n *WorkerNode) Start() error
Click to show internal directories.
Click to hide internal directories.