Skip to content

Latest commit

 

History

History

updatabletimer

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

helloworld

inspired by temporalio/samples-go/updatabletimer

Getting Started

  1. Run a temporal service
    temporal server start-dev
  2. In a different shell, run the example worker
    go run examples/updatabletimer/main.go worker
  3. In a different shell, execute the workflow
    # initialize background timer for 1h in the future
    go run examples/updatabletimer/main.go updatable-timer \
        --name example \
        --initial-wake-up-time $(TZ=UTC date -v+1H "+%Y-%m-%dT%H:%M:%SZ") \
        -d
    
    # query timer
    go run examples/updatabletimer/main.go get-wake-up-time -w updatable-timer/example
    
    # update timer for 30s in the future
    go run examples/updatabletimer/main.go update-wake-up-time \
        -w updatable-timer/example \
        --wake-up-time $(TZ=UTC date -v+30S "+%Y-%m-%dT%H:%M:%SZ")