jobrunner

package
v0.0.0-...-be78b2b Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package taskexecutor defines a "production-ready" task executor.

For local/non-production use, consider looking at cmd/localjobs's task executor

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTask

func CreateTask(ctx context.Context, pool *pgxpool.Pool, task tasks.TaskDefinition) (*types.TaskCreateResponse, error)

Sets up a task

func ExecuteTask

func ExecuteTask(taskId string, task tasks.TaskDefinition)

Creates a new task on server and executes it

Types

type MutLogger

type MutLogger struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewTaskLogger

func NewTaskLogger(taskId string, pool *pgxpool.Pool, ctx context.Context, baseLogger *zap.Logger) (*zap.Logger, *MutLogger)

func (*MutLogger) Sync

func (m *MutLogger) Sync() error

func (*MutLogger) Write

func (m *MutLogger) Write(p []byte) (n int, err error)

type TaskState

type TaskState struct{}

Implementor of tasks.TaskState

func (TaskState) Context

func (TaskState) Context() context.Context

func (TaskState) DebugInfo

func (TaskState) DebugInfo() *debug.BuildInfo

func (TaskState) Discord

func (TaskState) Discord() (*discordgo.Session, *discordgo.User, bool)

func (TaskState) OperationMode

func (TaskState) OperationMode() string

func (TaskState) Transport

func (TaskState) Transport() *http.Transport

Jump to

Keyboard shortcuts

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