Documentation
¶
Overview ¶
Package executor provides the Executor interface, which is an abstraction for "object which may execute a task."
Subpackages provide useful executors for building task-executing heirarchies. Each package exports just a few objects conforming to the Executor interface, and optionally a few helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor interface {
// Execute is given a task to execute and expected to populate result with the outcome.
Execute(ctx context.Context, session task.Session, tsk *task.Task, result *task.Result) error
// OpenSession is called before any tasks are executed, and can be used to do things such as
// initializing caches, etc.
OpenSession(ctx context.Context, session task.Session) error
// CloseSession shuts down and frees all resources created over the course of a session.
// After this call, no outstanding goroutines should be running.
CloseSession(ctx context.Context, sessionID task.SessionID)
}
Executor is the interface required to execute tasks.
type NoopSessionManager ¶
type NoopSessionManager struct{}
NoopSessionManager can be embedded if session management isn't necessary.
func (NoopSessionManager) CloseSession ¶
func (n NoopSessionManager) CloseSession(context.Context, task.SessionID)
CloseSession implements Executor.
func (NoopSessionManager) OpenSession ¶
OpenSession implements Executor.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package argconv provides an executor for automatically unboxing task parameters.
|
Package argconv provides an executor for automatically unboxing task parameters. |
|
Package observable provides an executor which alerts followers to task status
|
Package observable provides an executor which alerts followers to task status |
|
Package plugin provides an executor which uses go-plugin to launch gRPC subprocesses.
|
Package plugin provides an executor which uses go-plugin to launch gRPC subprocesses. |
|
Package router provides Router, which is meant to route tasks to child executors.
|
Package router provides Router, which is meant to route tasks to child executors. |
|
Package scheduler provides an executor which executes followup tasks and resolves dependencies.
|
Package scheduler provides an executor which executes followup tasks and resolves dependencies. |
|
Package statecheck provides an executor that avoids re-running tasks if they are already up to date.
|
Package statecheck provides an executor that avoids re-running tasks if they are already up to date. |
Click to show internal directories.
Click to hide internal directories.