pbtask

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: MIT Imports: 4 Imported by: 0

README

How to use Protobuf tasks

This example uses a protobuf message to define SpawnWorkflowTreeTask task.

The task definition is defined in workflow.proto and the task implementation is in example_workflow.go.

The generated code of workflow.proto is in workflow.pb.go and can be (re-)generated using the following command:

go generate ./...
  • submitter/main.go submits a workflow to Tilebox Workflows with a protobuf root task.
  • runner/main.go starts a task runner that can execute both protobuf and regular struct tasks.
  • tasks.go shows the protobuf task implementation and how to submit protobuf sub-tasks.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SampleTask

type SampleTask struct {
	Message      string
	Depth        int
	BranchFactor int
}

SampleTask is a regular struct task that submits a protobuf task.

func (*SampleTask) Execute

func (t *SampleTask) Execute(ctx context.Context) error

func (*SampleTask) Identifier

func (t *SampleTask) Identifier() workflows.TaskIdentifier

type SpawnWorkflowTreeTask

type SpawnWorkflowTreeTask struct {
	examplesv1.SpawnWorkflowTreeTask
}

SpawnWorkflowTreeTask embeds a protobuf message

func (*SpawnWorkflowTreeTask) Execute

func (t *SpawnWorkflowTreeTask) Execute(ctx context.Context) error

func (*SpawnWorkflowTreeTask) Identifier

func (t *SpawnWorkflowTreeTask) Identifier() workflows.TaskIdentifier

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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