worker

package
v0.0.0-...-0ea846c Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ExecutionTaskQueue = "EXECUTION_TASK_QUEUE"

ExecutionTaskQueue is the name of the task queue for the execution worker

View Source
const ExecutionWorkflowName = "execution-workflow"

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

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

Activity is the struct that contains the Temporal activity information

func NewActivity

func NewActivity(management *management.ManagementService) *Activity

NewActivity creates a new temporal activity

func (Activity) ExecutionActivity

func (a Activity) ExecutionActivity(ctx context.Context, execution model.NewExecution) (*ExecutionResult, error)

ExecutionActivity is the activity function that will compile and execute the code

type ExecutionResult

type ExecutionResult struct {
	Stdout          string
	Stderr          string
	RawTestsResults string
	TestsResults    []TestResult
}

ExecutionResult is the struct that contains the result of the execution

type TestResult

type TestResult struct {
	TestName string
	Expected string
	Actual   string
	Passed   bool
}

TestResult is the struct that contains the result of an assignment test

type Worker

type Worker struct{}

Worker is the struct that contains the Temporal worker

func (Worker) InitWorker

func (r Worker) InitWorker() error

InitWorker initializes the Temporal worker and registers the workflows and activities

type Workflow

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

Workflow is the struct that contains the Temporal workflow and the activity

func NewWorkflow

func NewWorkflow(activity *Activity) *Workflow

NewWorkflow creates a new Workflow struct

func (Workflow) ExecutionWorkflow

func (w Workflow) ExecutionWorkflow(ctx workflow.Context, execution model.NewExecution) (*ExecutionResult, error)

ExecutionWorkflow is the Workflow function that will be executed by Temporal when a new execution is received

Directories

Path Synopsis
compilers

Jump to

Keyboard shortcuts

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