example

package
v1.14.3 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 6 Imported by: 0

README

example protoc-gen-go-temporal usage

  1. Start temporal
    temporal server start-dev \
        --dynamic-config-value "frontend.enableUpdateWorkflowExecution=true" \
        --dynamic-config-value "frontend.enableUpdateWorkflowExecutionAsyncAccepted=true"
    
  2. In a different terminal, run the worker
    go run examples/example/cmd/main.go worker
    
  3. In a different terminal, execute a workflow, signal, query, and update
    # execute a workflow in the background
    go run examples/example/cmd/main.go create-foo --name test -d
    
    # signal the workflow
    go run examples/example/cmd/main.go set-foo-progress -w create-foo/test --progress 5.7
    
    # query the workflow
    go run examples/example/cmd/main.go get-foo-progress -w create-foo/test
    
    # update the workflow
    go run examples/example/cmd/main.go update-foo-progress -w create-foo/test --progress 100
    

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activities

type Activities struct{}

Activities manages shared state for activities and is used to register activities with a worker

func (*Activities) Notify

func (a *Activities) Notify(ctx context.Context, req *examplev1.NotifyRequest) error

Notify defines the implementation for a Notify activity

type CreateFooWorkflow

type CreateFooWorkflow struct {
	// it embeds the generated workflow Input type that contains the workflow
	// input and signal helpers
	*examplev1.CreateFooWorkflowInput
	// contains filtered or unexported fields
}

CreateFooWorkflow manages workflow state for a CreateFoo workflow

func (*CreateFooWorkflow) Execute

Execute defines the entrypoint to a example.v1.Example.CreateFoo workflow

func (*CreateFooWorkflow) GetFooProgress

func (wf *CreateFooWorkflow) GetFooProgress() (*examplev1.GetFooProgressResponse, error)

GetFooProgress defines the handler for a GetFooProgress query

func (*CreateFooWorkflow) UpdateFooProgress

UpdateFooProgress defines the handler for an UpdateFooProgress update

type Workflows

type Workflows struct{}

Workflows manages shared state for workflow constructors and is used to register workflows with a worker

func (*Workflows) CreateFoo

CreateFoo initializes a new examplev1.CreateFooWorkflow value

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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