samples

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivitySequenceOrchestrator

func ActivitySequenceOrchestrator(ctx *task.OrchestrationContext) (any, error)

ActivitySequenceOrchestrator makes three activity calls in sequence and results the results as an array.

func CallHttpEndpointActivity

func CallHttpEndpointActivity(ctx task.ActivityContext) (any, error)

func ConfigureZipkinTracing

func ConfigureZipkinTracing() *trace.TracerProvider

func DistributedTraceSampleOrchestrator

func DistributedTraceSampleOrchestrator(ctx *task.OrchestrationContext) (any, error)

DistributedTraceSampleOrchestrator is a simple orchestration that's intended to generate distributed trace output to the configured exporter (e.g. zipkin).

func DoWorkActivity

func DoWorkActivity(ctx task.ActivityContext) (any, error)

DoWorkActivity is a no-op activity function that sleeps for a specified amount of time.

func ExternalEventOrchestrator

func ExternalEventOrchestrator(ctx *task.OrchestrationContext) (any, error)

ExternalEventOrchestrator is an orchestrator function that blocks for 30 seconds or until a "Name" event is sent to it.

func GetDevicesToUpdate

func GetDevicesToUpdate(task.ActivityContext) (any, error)

GetDevicesToUpdate is an activity that returns a list of random device IDs to an orchestration.

func Init

Init creates and initializes an in-memory client and worker pair with default configuration.

func RunDistributedTracingSample

func RunDistributedTracingSample()

func RunExternalEventsSample

func RunExternalEventsSample()

func RunParallelSample

func RunParallelSample()

func RunSequenceSample

func RunSequenceSample()

func SayHelloActivity

func SayHelloActivity(ctx task.ActivityContext) (any, error)

SayHelloActivity can be called by an orchestrator function and will return a friendly greeting.

func UpdateDevice

func UpdateDevice(ctx task.ActivityContext) (any, error)

UpdateDevice is an activity that takes a device ID (string) and pretends to perform an update on the corresponding device, with a random 67% success rate.

func UpdateDevicesOrchestrator

func UpdateDevicesOrchestrator(ctx *task.OrchestrationContext) (any, error)

UpdateDevicesOrchestrator is an orchestrator that runs activities in parallel

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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