You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+48-27Lines changed: 48 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,9 @@ execute asynchronous, long-running business logic in a scalable and resilient wa
10
10
"Temporal Python SDK" is the framework for authoring workflows and activities using the Python programming language.
11
11
12
12
Also see:
13
-
*[Application Development Guide](https://docs.temporal.io/application-development?lang=python) - Once you've tried our [Quick Start](#quick-start), check out our guide on how to use Temporal in your Python applications, including information around Temporal core concepts.
13
+
*[Application Development Guide](https://docs.temporal.io/application-development?lang=python) - Once you've tried our
14
+
[Quick Start](#quick-start), check out our guide on how to use Temporal in your Python applications, including
-[Heartbeating and Cancellation](#heartbeating-and-cancellation)
93
95
-[Worker Shutdown](#worker-shutdown)
@@ -111,7 +113,9 @@ informal introduction to the features and their implementation.
111
113
112
114
# Quick Start
113
115
114
-
We will guide you through the Temporal basics to create a "hello, world!" script on your machine. It is not intended as one of the ways to use Temporal, but in reality it is very simplified and decidedly not "the only way" to use Temporal. For more information, check out the docs references in "Next Steps" below the quick start.
116
+
We will guide you through the Temporal basics to create a "hello, world!" script on your machine. It is not intended as
117
+
one of the ways to use Temporal, but in reality it is very simplified and decidedly not "the only way" to use Temporal.
118
+
For more information, check out the docs references in "Next Steps" below the quick start.
115
119
116
120
## Installation
117
121
@@ -136,7 +140,7 @@ Create the following in `activities.py`:
136
140
from temporalio import activity
137
141
138
142
@activity.defn
139
-
asyncdefsay_hello(name: str) -> str:
143
+
defsay_hello(name: str) -> str:
140
144
returnf"Hello, {name}!"
141
145
```
142
146
@@ -163,6 +167,7 @@ Create the following in `run_worker.py`:
with concurrent.futures.ThreadPoolExecutor(max_workers=100) as activity_executor:
184
+
worker = Worker(
185
+
client,
186
+
task_queue="my-task-queue",
187
+
workflows=[SayHello],
188
+
activities=[say_hello],
189
+
activity_executor=activity_executor,
190
+
)
191
+
await worker.run()
180
192
181
193
if__name__=="__main__":
182
194
asyncio.run(main())
@@ -235,8 +247,9 @@ give you much more information about how Temporal works with Python:
235
247
236
248
# Usage
237
249
238
-
From here, you will find reference documentation about specific pieces of the Temporal Python SDK that were built around Temporal concepts.
239
-
*This section is not intended as a how-to guide* -- For more how-to oriented information, check out the links in the [Next Steps](#next-steps) section above.
250
+
From here, you will find reference documentation about specific pieces of the Temporal Python SDK that were built around
251
+
Temporal concepts. *This section is not intended as a how-to guide* -- For more how-to oriented information, check out
252
+
the links in the [Next Steps](#next-steps) section above.
240
253
241
254
### Client
242
255
@@ -269,6 +282,7 @@ Some things to note about the above code:
269
282
does the same thing
270
283
* Clients can have many more options not shown here (e.g. data converters and interceptors)
271
284
* A string can be used instead of the method reference to call a workflow by name (e.g. if defined in another language)
285
+
* Clients to not work across forks
272
286
273
287
Clients also provide a shallow copy of their config for use in making slightly different clients backed by the same
274
288
connection. For instance, given the `client` above, this is how to have a client in another namespace:
0 commit comments