|
4 | 4 |
|
5 | 5 | # dispatch-py
|
6 | 6 |
|
7 |
| -[](https://github.com/dispatchrun/dispatch-py/actions/workflows/docs.yml) |
8 |
| -[](https://github.com/dispatchrun/dispatch-py/actions/workflows/pypi.yml) |
9 |
| -[](https://github.com/dispatchrun/dispatch-py/actions/workflows/test.yml) |
| 7 | +[](https://github.com/dispatchrun/dispatch-py/actions/workflows/docs.yml) |
| 8 | +[](https://github.com/dispatchrun/dispatch-py/actions/workflows/pypi.yml) |
| 9 | +[](https://github.com/dispatchrun/dispatch-py/actions/workflows/test.yml) |
10 | 10 | [](https://badge.fury.io/py/dispatch-py)
|
11 | 11 | [](https://python.dispatch.run/main/reference/dispatch/)
|
12 | 12 |
|
13 | 13 | Python package to develop applications with the Dispatch platform.
|
14 | 14 |
|
15 | 15 | [fastapi]: https://fastapi.tiangolo.com/tutorial/first-steps/
|
16 |
| -[pypi]: https://pypi.org/project/dispatch-py/ |
17 |
| -[signup]: https://console.dispatch.run/ |
| 16 | +[pypi]: https://pypi.org/project/dispatch-py/ |
| 17 | +[signup]: https://console.dispatch.run/ |
18 | 18 |
|
19 | 19 | - [What is Dispatch?](#what-is-dispatch)
|
20 | 20 | - [Installation](#installation)
|
@@ -52,14 +52,15 @@ brew install dispatch
|
52 | 52 | Alternatively, you can download the latest `dispatch` binary from the
|
53 | 53 | [Releases](https://github.com/dispatchrun/dispatch/releases) page.
|
54 | 54 |
|
55 |
| -*Note that this step is optional, applications that use Dispatch can run without |
| 55 | +_Note that this step is optional, applications that use Dispatch can run without |
56 | 56 | the CLI, passing configuration through environment variables or directly in the
|
57 | 57 | code. However, the CLI automates the onboarding flow and simplifies the
|
58 |
| -configuration, so we recommend starting with it.* |
| 58 | +configuration, so we recommend starting with it._ |
59 | 59 |
|
60 | 60 | ### Installing the Dispatch SDK
|
61 | 61 |
|
62 | 62 | The Python package is published on [PyPI][pypi] as **dispatch-py**, to install:
|
| 63 | + |
63 | 64 | ```console
|
64 | 65 | pip install dispatch-py
|
65 | 66 | ```
|
@@ -93,19 +94,21 @@ interesting work, but it's a good start to get a sense of how to use Dispatch.
|
93 | 94 |
|
94 | 95 | The simplest way to run a Dispatch application is to use the Dispatch CLI, first
|
95 | 96 | we need to login:
|
| 97 | + |
96 | 98 | ```console
|
97 | 99 | dispatch login
|
98 | 100 | ```
|
99 | 101 |
|
100 | 102 | Then we are ready to run the example program we wrote above:
|
| 103 | + |
101 | 104 | ```console
|
102 | 105 | dispatch run -- python3 main.py
|
103 | 106 | ```
|
104 | 107 |
|
105 | 108 | ### Writing Transactional Applications with Dispatch
|
106 | 109 |
|
107 | 110 | The `@dispatch.function` decorator can also be applied to Python coroutines
|
108 |
| -(a.k.a. *async* functions), in which case each `await` point becomes a |
| 111 | +(a.k.a. _async_ functions), in which case each `await` point becomes a |
109 | 112 | durability step in the execution. If the awaited operation fails, it is
|
110 | 113 | automatically retried, and the parent function is paused until the result are
|
111 | 114 | available or a permanent error is raised.
|
@@ -153,10 +156,10 @@ async def transform(msg):
|
153 | 156 | ...
|
154 | 157 | ```
|
155 | 158 |
|
156 |
| -Dispatch converts Python coroutines to *Distributed Coroutines*, which can be |
| 159 | +Dispatch converts Python coroutines to _Distributed Coroutines_, which can be |
157 | 160 | suspended and resumed on any instance of a service across a fleet. For a deep
|
158 | 161 | dive on these concepts, read our blog post on
|
159 |
| -[*Distributed Coroutines with a Native Python Extension and Dispatch*](https://dispatch.run/blog/distributed-coroutines-in-python). |
| 162 | +[_Distributed Coroutines with a Native Python Extension and Dispatch_](https://dispatch.run/blog/distributed-coroutines-in-python). |
160 | 163 |
|
161 | 164 | ### Integration with FastAPI
|
162 | 165 |
|
|
0 commit comments