executionmiddleware

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentJobBlocker

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

ConcurrentJobBlocker is a Middleware that will defer a job if one is already running

func NewCJLock

func NewCJLock() *ConcurrentJobBlocker

NewCJLock Create a new ConcurrentJob Lock Middleware

func (*ConcurrentJobBlocker) Initilize

func (hth *ConcurrentJobBlocker) Initilize(s *taskmanager.Task)

func (*ConcurrentJobBlocker) PostHandler

func (hth *ConcurrentJobBlocker) PostHandler(s *taskmanager.Task, err error) taskmanager.MWResult

func (*ConcurrentJobBlocker) PreHandler

func (hth *ConcurrentJobBlocker) PreHandler(s *taskmanager.Task) (taskmanager.MWResult, error)

func (*ConcurrentJobBlocker) Reset

func (hth *ConcurrentJobBlocker) Reset(s *taskmanager.Task)

type HasTagHandler

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

HasTagHandler is a Middleware that will Defer jobs if the Requirements are not meet Requirements are Specified as "Tags" (strings) and a Job has a list of Tags needed When a Job is about to be dispatched, the Jobs "Required" tags are compared against a list of "available" tags, and if the available tags does not match the required tags, the job is deferred (or canceled if there is no other Middleware after this one.)

func NewTagHandler

func NewTagHandler() *HasTagHandler

NewTagHandlerMW Create a new Tag Handler Middleware

func (*HasTagHandler) DelHaveTags

func (hth *HasTagHandler) DelHaveTags(tag string)

DelHaveTags Delete a tag indicating a resource is no longer available.

func (*HasTagHandler) DelRequiredTags

func (hth *HasTagHandler) DelRequiredTags(tag string)

DelRequiredTags delete a tag that a job requires.

func (*HasTagHandler) Initilize

func (hth *HasTagHandler) Initilize(s *taskmanager.Task)

func (*HasTagHandler) IsHaveTag

func (hth *HasTagHandler) IsHaveTag(tag string) bool

IsHaveTag Test if a resource represented by tag is present

func (*HasTagHandler) IsRequiredTag

func (hth *HasTagHandler) IsRequiredTag(tag string) bool

IsRequiredTag test if a resource requirement represented by tag is available

func (*HasTagHandler) PostHandler

func (hth *HasTagHandler) PostHandler(s *taskmanager.Task, err error) taskmanager.MWResult

func (*HasTagHandler) PreHandler

func (hth *HasTagHandler) PreHandler(s *taskmanager.Task) (taskmanager.MWResult, error)

Handler Runs the Tag Handler before a job is dispatched.

func (*HasTagHandler) Reset

func (hth *HasTagHandler) Reset(s *taskmanager.Task)

func (*HasTagHandler) SetHaveTags

func (hth *HasTagHandler) SetHaveTags(tag string)

SetHaveTags Set a tag indicating that a resource is available. Before a job runs with a Matching Required tag, it checks if its present.

func (*HasTagHandler) SetRequiredTags

func (hth *HasTagHandler) SetRequiredTags(tag string)

SetRequiredTags add a tag that makes a job dependant upon a resource being available (set via SetHaveTag)

Jump to

Keyboard shortcuts

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