Git Product home page Git Product logo

demo-go's Introduction

temporal-go-demo

Temporal demo for Go meetups

Go Temporal Sample for Go Meetup

This package contains a sample demoed at Go's 10th Anniversary Seattle Meetup

More Temporal info at:

Overview of the Samples

Money Transfer Sample

Demonstrates a simple transfer from one account to another.

Get the Samples

Run the following commands:

  git clone [email protected]:temporalio/temporal-go-demo.git
  cd temporal-go-demo

Build the Samples

  make

Run Temporal Server

Run Temporal Server using Docker Compose:

curl -O https://raw.githubusercontent.com/uber/cadence/master/docker/docker-compose.yml
docker-compose up

If this does not work, see the instructions for running Temporal Server at https://github.com/uber/cadence/blob/master/README.md.

Install Temporal CLI

Command Line Interface Documentation

See Temporal UI

The Temporal Server running in a docker container includes a Web UI.

Connect to http://localhost:8088.

Enter the samples domain. You'll see a "No Results" page. After running any sample, change the filter in the top right corner from "Open" to "Closed" to see the list of the completed workflows.

Click on a RUN ID of a workflow to see more details about it. Try different view formats to get a different level of details about the execution history.

Run the samples

Each sample has specific requirements for running it. The following sections contain information about how to run each of the samples after you've built them using the preceding instructions.

Money Transfer Sample

Workflow Worker:

./bins/workflowWorker

Activities Worker:

./bins/activityWorker

Initiate Transfer:

tctl wf start --tl transfer --wt transfer --et 1200  --if ./transferRequest.json

Initiate Transfer Specifying Id of "T1":

tctl wf start --w T1 --tl transfer --wt transfer --et 1200  --if ./transferRequest.json

Initiate Transfer Specifying Id of "T1" and "reject duplicate workflow ID" ID reuse policy:

tctl wf start --w T1 --wrp 1 --tl transfer --wt transfer --et 1200  --if ./transferRequest.json

Batch Transfer Sample

Workflow Worker:

./bins/workflowWorker

Activities Worker:

./bins/activityWorker

Initiate Batch Transfer:

tctl wf start -w batch-transfer-1 --tl transfer --wt batch-transfer --et 1200 --if ./batchTransferRequest.json

Send Signal For First Withdrawal:

tctl wf signal -w batch-transfer-1 --name withdraw --if ./withdrawSignalPayload1.json

Send Signal For Second Withdrawal:

tctl wf signal -w batch-transfer-1 --name withdraw --if ./withdrawSignalPayload2.json

Send Signal For Third Withdrawal:

tctl wf signal -w batch-transfer-1 --name withdraw --if ./withdrawSignalPayload3.json

Query Withdrawal Count:

tctl wf query -w batch-transfer-1 --qt get-count

Query Balance:

tctl wf query -w batch-transfer-1 --qt get-balance

demo-go's People

Contributors

samarabbas avatar alexshtin avatar mfateev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.