🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

github.com/xdire/temporal-async

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/xdire/temporal-async

v0.0.0-20240911203215-fc37c748b5a7
Version published
Created

temporal-async

Asynchronous execution of ordinary workflow

Why

This repository shows how to create Temporal worker with a simple processing task

How

  • Temporal binary need to be installed in your system
temporal server start-dev --db-filename temporal.db
  • Run worker from this folder
go run service-worker/main.go
  • Run the API service to manipulate the workflow
go run service-api/main.go
  • Start the workflow and observe workflow in the temporal UI
curl -v -X POST 'http://localhost:8093/process/create?name=xxx&desc=testprocess'
  • Workflow will be awaiting next signals, that can update the Process record
curl -X PATCH 'http://localhost:8093/process/stage?id=proc_${ID_FROM_UI}&stage=execute'
  • Confirm that workflow can move into the final part of the execution
curl -X PATCH 'http://localhost:8093/process/stage?id=proc_${ID_FROM_UI}&stage=finalize'
  • Complete the workflow with the confirmation signal
curl -X PATCH 'http://localhost:8093/process/confirm?id=proc_${ID_FROM_UI}'   
  • Observe workflow completed and went through all the execution steps in the Event History

FAQs

Package last updated on 11 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts