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 RuntimeInfo ¶
type RuntimeInfo struct {
SubmitTime clock.MonotonicTime
}
RuntimeInfo records some information related to the runnable object
Click to show internal directories.
Click to hide internal directories.