worker

package
v0.0.0-...-ab49fd9 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Socket     *socket.Socket       `json:"socket"`
	Execution  string               `json:"execution"`
	StartTime  time.Time            `json:"start_time"`
	EndTime    time.Time            `json:"end_time"`
	Database   *config.Database     `json:"database"`
	Parameters []*storage.Parameter `json:"parameters"`
}

type Instance

type Instance struct {
	Service *serviceStorage.Instance `json:"-"`

	Running bool `json:"running"`
	// contains filtered or unexported fields
}

func (*Instance) Configure

func (i *Instance) Configure(ctx context.Context, configuration *Configuration) error

func (*Instance) Run

func (i *Instance) Run(ctx context.Context) error

func (*Instance) Stop

func (i *Instance) Stop(ctx context.Context) error

Stop Send request to worker that the execution is over. Expecting the worker to reply and then terminate safely

type Pool

type Pool interface {
	Configure(context.Context, *Configuration) error
	Run(context.Context) error
	Process(context.Context, *message.Request) (*message.Response, error)
	Stop(context.Context) error
}

func NewPool

func NewPool(ctx context.Context, serverConfig *config.Config, port int, instances ...*serviceStorage.Instance) (Pool, error)

Jump to

Keyboard shortcuts

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