xepozz / symfony-temporal-demo

2 stars 0 forks source link

Introduction

This is demo application to show how to work with Temporal from Symfony application.

This package based on BaldinofRoadRunnerBundle.

Temporary used fork https://github.com/xepozz/roadrunner-bundle/tree/add-temporal-support before it will be merged into original repo.

Installation

Install PHP dependencies:

composer i --prefer-dist

Get RoadRunner binary:

./vendor/bin/rr get-binary

Run docker containers:

docker-compose up -d

Run RoadRunner:

./rr serve

Usage

Now you can open http://localhost:8080 and see small description about examples:

This project is example how to use Temporal with Symfony application.
There are exist several examples how it works.
Examples:
If you want to see how "simple" workflow works click here.
There is usual call non-blocking action. It should work as faster as you can run usual php code.
If you want to see how "complicated" workflow works click here.
There are imitation for blocking action. Different methods calls will run with random delay: from 1 to 5 seconds per call.
If you want to see how "deferred" workflow works click here.
There are imitation for asynchronous action. You will get "job id" and you can track the status in another endpoint.
Logic for workflow will be same as "complicated" workflow.

Also, you can open Temporal admin panel the located in http://localhost:8088

Contribution

You are welcome to add more examples, fix bugs or orthographic errors.

Useful links

Used libraries

BaldinofRoadRunnerBundle Temporal PHP SDK RoadRunner

Temporal:

Temporal (temporal.io)

Workshops

1st part Оркестрируй это! Описываем сложные бизнес процессы на PHP - Антон Титов

2nd part Оркестрация и закон Мерфи: обрабатываем ошибки-бизнес процессов

Application (after run on local machine)

This application demo

Temporal admin panel