internal

package
v0.0.0-...-690b2a9 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskSubmitted = RunnableStatus(iota + 1)
	TaskRunning
	TaskClosing
)

Defines all RunnableStatus

Variables

This section is empty.

Functions

This section is empty.

Types

type Runnable

type Runnable interface {
	Run(ctx context.Context) error
	ID() RunnableID
}

Runnable defines an interface that can be run in task runner

type RunnableContainer

type RunnableContainer struct {
	Runnable
	// contains filtered or unexported fields
}

RunnableContainer implements Runnable, and maintains some more running information

func WrapRunnable

func WrapRunnable(runnable Runnable, submitTime clock.MonotonicTime) *RunnableContainer

WrapRunnable creates a new RunnableContainer from a Runnable interface

func (*RunnableContainer) Info

func (c *RunnableContainer) Info() RuntimeInfo

Info returns the info of RunnableContainer

func (*RunnableContainer) OnLaunched

func (c *RunnableContainer) OnLaunched()

OnLaunched is the callback when the runnable instance is launched.

func (*RunnableContainer) OnStopped

func (c *RunnableContainer) OnStopped()

OnStopped is the callback when the runnable instance is stopped

func (*RunnableContainer) Status

func (c *RunnableContainer) Status() RunnableStatus

Status returns the status of RunnableContainer

type RunnableID

type RunnableID = string

RunnableID is a unique id for the runnable

type RunnableStatus

type RunnableStatus = int32

RunnableStatus is the runtime container status

type RuntimeInfo

type RuntimeInfo struct {
	SubmitTime clock.MonotonicTime
}

RuntimeInfo records some information related to the runnable object

Jump to

Keyboard shortcuts

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