inmem

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: CC0-1.0, CC0-1.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SubmitterStorage Requests
	SubmitReq = iota
	SubmitFileReq
	StatusReq
	InfoReq
	ListReq
	ListWithPriorityReq
	DeleteReq
	DescribeReq

	// WorkerStorage requests. Note that Next is not implemented via a request. Instead the next task is read from the scheduler channel
	RetrieveFileReq
	SuccessReq
	ErrorReq
	RequeueReq
	FatalReq
	HeartbeatReq

	// ActivateReq marks a task as active
	ActivateReq
)

The request codes

Variables

View Source
var (
	ErrNilScheduler = errors.New("illegal nil *scheduler")
	ErrClosed       = errors.New("the scheduler is closed")
)

Errors

Functions

func New

func New(ctx context.Context, cfg *Config) (job.Storage, error)

New creates a new in-memory job server with the given configuration.

Types

type Config

type Config struct {
	*ir.Config
	Fs fs.Interface // the fs storage on which files and directories in the manifest live
}

Config describes the configuration options we allow a user to set on an inmem instance.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a new client configuration initialised with the default values.

func SetDefaultConfig

func SetDefaultConfig(c *Config) *Config

SetDefaultConfig sets the default configuration to c and returns the old default configuration. This change will be reflected in future calls to DefaultConfig.

func (*Config) Copy

func (c *Config) Copy() *Config

Copy returns a copy of the configuration.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration, returning an error if there's a problem.

Jump to

Keyboard shortcuts

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