Coder Social home page Coder Social logo

cadence-go-demo's Introduction

cadence-go-demo

Cadence demo for GO meetups

GO Cadence Sample for GO Meetup

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

More Cadence 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]:samarabbas/cadence-go-demo.git
  cd cadence-go-demo

Build the Samples

  make

Run Cadence Server

Run Cadence 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 Cadence Server at https://github.com/uber/cadence/blob/master/README.md.

Install Cadence CLI

Command Line Interface Documentation

Register the Domain

To register the sample domain, run the following command once before running any samples:

cadence --do samples d re --rd 2 --oe "user@email" --desc "samples domain"

See Cadence UI

The Cadence 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:

cadence --do samples wf start --tl samples_workflow_tl --wt transfer --wid transferAToB-1 --dt 2 --et 1200 --wrp 1 --if ./transferRequest.json

Batch Transfer Sample

Workflow Worker:

./bins/workflowWorker

Activities Worker:

./bins/activityWorker

Initiate Batch Transfer:

cadence --do samples wf start --tl samples_workflow_tl --wt batch-transfer --wid batch-transfer-1 --dt 2 --et 1200 --wrp 1 --if ./batchTransferRequest.json

Send Signal For First Withdrawal:

cadence --do samples wf signal -w batch-transfer-1 --name withdraw --if ./withdrawSignalPayload1.json

Send Signal For Second Withdrawal:

cadence --do samples wf signal -w batch-transfer-1 --name withdraw --if ./withdrawSignalPayload2.json

Send Signal For Third Withdrawal:

cadence --do samples wf signal -w batch-transfer-1 --name withdraw --if ./withdrawSignalPayload3.json

Query Withdrawal Count:

./cadence --do samples wf query -w batch-transfer-1 --qt get-count

Query Balance:

./cadence --do samples wf query -w batch-transfer-1 --qt get-balance

cadence-go-demo's People

Contributors

mfateev avatar samarabbas avatar

Watchers

 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.