scheduler

package
v0.0.0-...-c2f40a1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ExecuteTaskName = "Scheduler.ExecuteTask"

ExecuteTaskName is needed for the client side. Client runs this function through an rpc, then Scheduler class calls whichever task is needed.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AvailableServers []ServerConfiguration `json:"availableServers"`
}

Config contains a list of server configurations for the scheduler with keys for json parsing.

type Scheduler

type Scheduler struct {
	Port    uint
	Address string
	Servers []ServerInfo
	// contains filtered or unexported fields
}

Scheduler handles the load balancing. It stores the information about all

func (*Scheduler) ExecuteTask

func (scheduler *Scheduler) ExecuteTask(request *core.Request, response *core.Response) (err error)

ExecuteTask is used for transparency with the client. The client requests the task to be executed, but doesn't know which node exactly will execute the task. This function handles all the decisions for the

func (*Scheduler) Init

func (scheduler *Scheduler) Init() (err error)

Init initialises new scheduler and makes connections to all the server nodes.

type ServerConfiguration

type ServerConfiguration struct {
	Name           string   `json:"name"`
	Address        string   `json:"address"`
	Port           uint     `json:"port"`
	Type           string   `json:"type"`
	SupportedTasks []string `json:"supportedTasks"`
}

ServerConfiguration contains configuration for one server and keys for the json parsing.

type ServerInfo

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

ServerInfo stores information about servers.

Jump to

Keyboard shortcuts

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