|
| 1 | +--- |
| 2 | +title: Tour of Code |
| 3 | +description: A tour through the code |
| 4 | +--- |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | +There are 5 Go services total: [3 “microservices”][domain-services] responsible for |
| 9 | +domain data, and [2 services][temporal-services] which interact with Temporal. |
| 10 | + |
| 11 | +One of those services is the “starter” which clients pass data to. The “Starter” |
| 12 | +[accepts all input data, starts a workflow, and immediately returns][starter] |
| 13 | +some key data, such as the workflow ID and various primary keys of the created |
| 14 | +data. This is actually a good user experience, because clients hear back from |
| 15 | +the server as soon as possible, while the backend can chug along with complex |
| 16 | +asynchronous work. |
| 17 | + |
| 18 | +Once the workflow has started and been received by the Temporal Cluster, the |
| 19 | +message will be dispatched to our [“Worker”][worker], which has |
| 20 | +[registered][register] a [workflow definition][workflow-definition], as well as |
| 21 | +a [controller][controller] for making the network requests for of our |
| 22 | +[3 activities][execute-activity]. |
| 23 | + |
| 24 | +[worker]: https://github.com/kevinmichaelchen/temporal-saga-grpc/blob/v0.1.0/cmd/saga/worker/app/worker/worker.go#L109-L152 |
| 25 | +[register]: https://github.com/kevinmichaelchen/temporal-saga-grpc/blob/v0.1.0/cmd/saga/worker/app/worker/worker.go#L126-L132 |
| 26 | +[workflow-definition]: https://github.com/kevinmichaelchen/temporal-saga-grpc/blob/v0.1.0/pkg/saga/workflow.go |
| 27 | +[controller]: https://github.com/kevinmichaelchen/temporal-saga-grpc/blob/v0.1.0/pkg/saga/activity.go |
| 28 | +[execute-activity]: https://github.com/kevinmichaelchen/temporal-saga-grpc/blob/v0.1.0/pkg/saga/workflow.go#L39-L55 |
| 29 | +[starter]: https://github.com/kevinmichaelchen/temporal-saga-grpc/blob/v0.1.0/cmd/saga/start/service/service.go |
| 30 | +[domain-services]: https://github.com/kevinmichaelchen/temporal-saga-grpc/tree/v0.1.0/cmd/svc |
| 31 | +[temporal-services]: https://github.com/kevinmichaelchen/temporal-saga-grpc/tree/v0.1.0/cmd/saga |
0 commit comments