superviser

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Overview

Package superviser provides Go RPC implementation of client and server for Superviser interface.

It also provides superviserReception that may be used with StartSuperviserReception to record IP address of the client and call SetWorkerIP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSuperviserService

func RegisterSuperviserService(server *rpc.Server, impl Superviser) error

RegisterSuperviserService registers impl in server.

func StartSuperviserReception

func StartSuperviserReception(sv boruta.Superviser, addr string) (err error)

StartSuperviserReception starts listener on addr. For each connection it extracts information about client's IP address and serves the connection. In the handler of Register, the extracted address is used in call to SetWorkerIP of WorkerList after successful Register of WorkerList.

SetFail is unchanged, i.e. it calls SetFail of WorkerList without modification of arguments and return values.

Types

type SuperviserClient

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

SuperviserClient is generated client for Superviser interface.

func DialSuperviserClient

func DialSuperviserClient(addr string) (*SuperviserClient, error)

DialSuperviserClient connects to addr and creates a new SuperviserClient instance.

func NewSuperviserClient

func NewSuperviserClient(client *rpc.Client) *SuperviserClient

NewSuperviserClient creates a new SuperviserClient instance.

func (*SuperviserClient) Close

func (_c *SuperviserClient) Close() error

Close terminates the connection.

func (*SuperviserClient) Register

func (_c *SuperviserClient) Register(caps Capabilities, dryadAddress string, sshAddress string) (err error)

Register is part of implementation of Superviser calling corresponding method on RPC server.

func (*SuperviserClient) SetFail

func (_c *SuperviserClient) SetFail(uuid WorkerUUID, reason string) (err error)

SetFail is part of implementation of Superviser calling corresponding method on RPC server.

type SuperviserRegisterRequest

type SuperviserRegisterRequest struct {
	Caps         Capabilities
	DryadAddress string
	SshAddress   string
}

SuperviserRegisterRequest is a helper structure for Register method.

type SuperviserRegisterResponse

type SuperviserRegisterResponse struct {
}

SuperviserRegisterResponse is a helper structure for Register method.

type SuperviserService

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

SuperviserService is generated service for Superviser interface.

func NewSuperviserService

func NewSuperviserService(impl Superviser) *SuperviserService

NewSuperviserService creates a new SuperviserService instance.

func (*SuperviserService) Register

func (s *SuperviserService) Register(request *SuperviserRegisterRequest, response *SuperviserRegisterResponse) (err error)

Register is RPC implementation of Register calling it.

func (*SuperviserService) SetFail

func (s *SuperviserService) SetFail(request *SuperviserSetFailRequest, response *SuperviserSetFailResponse) (err error)

SetFail is RPC implementation of SetFail calling it.

type SuperviserSetFailRequest

type SuperviserSetFailRequest struct {
	Uuid   WorkerUUID
	Reason string
}

SuperviserSetFailRequest is a helper structure for SetFail method.

type SuperviserSetFailResponse

type SuperviserSetFailResponse struct {
}

SuperviserSetFailResponse is a helper structure for SetFail method.

Jump to

Keyboard shortcuts

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