splitmerge

package
v0.0.0-...-94a9b73 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

This sample Workflow Definition demonstrates how to use multiple Temporal coroutines (instead of native goroutine) to process a chunk of a large work item in parallel, and then merge the intermediate result to generate the final result. In Temporal Workflow Definition, you should not use goroutines. Instead, you use corotinues via the workflow.Go method.

Steps to run this sample:

  1. You need a Temporal service running. See details in README.md
  2. Run the following command to start the worker
go run splitmerge/worker/main.go
  1. Run the following command to start the example
go run splitmerge/starter/main.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkResult

type ChunkResult struct {
	NumberOfItemsInChunk int
	SumInChunk           int
}

ChunkResult contains the result for this sample

func ChunkProcessingActivity

func ChunkProcessingActivity(ctx context.Context, chunkID int) (result ChunkResult, err error)

func SampleSplitMergeWorkflow

func SampleSplitMergeWorkflow(ctx workflow.Context, workerCount int) (ChunkResult, error)

SampleSplitMergeWorkflow workflow definition

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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