distribute

package
v0.0.0-...-4e0088c Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunMaster

func RunMaster(addr string)

运行主服务器

func RunWorker

func RunWorker(mAddr, wAddr string)

运行子任务

Types

type DoJobArgs

type DoJobArgs struct {
	JobType string
	Urls    []string
}

定义RPC参数

type DoJobReply

type DoJobReply struct {
	OK bool
}

定义RPC调用返回结果

type Master

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

定义主任务结构体

func (*Master) Register

func (m *Master) Register(args *RegisterArgs, res *RegisterReply) error

注册RPC子任务

type RegisterArgs

type RegisterArgs struct {
	Worker string
}

定义RPC注册参数

type RegisterReply

type RegisterReply struct {
	OK bool
}

定义RPC注册返回参数

type WorkInfo

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

定义子任务信息结构体

type Worker

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

定义子任务结构体

func (*Worker) DoJob

func (w *Worker) DoJob(args *DoJobArgs, res *DoJobReply) error

执行RPC子任务

Jump to

Keyboard shortcuts

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