Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Develop with Python Documentation #2814

Merged
merged 35 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e3fe85d
Python Table of Contents
rachfop May 8, 2024
4a671a7
Remove script
rachfop May 8, 2024
a09a90e
Warn on broken links build
rachfop May 8, 2024
25835bd
Update titles and subtitles
rachfop May 8, 2024
85e1479
Fix yarn format
rachfop May 8, 2024
0ccfb8f
stuff
rachfop May 8, 2024
30529ca
merge changes
rachfop May 8, 2024
47120b6
Fix weird format issues
rachfop May 8, 2024
67ef1ee
Merge branch 'main' into python-toc
rachfop May 8, 2024
6987ea3
Merge branch 'main' into python-toc
rachfop May 9, 2024
712520c
Adds TOC
rachfop May 9, 2024
a6fe546
Merge branch 'python-toc' of https://github.com/temporalio/documentat…
rachfop May 9, 2024
6ca5cb9
Fix slug
rachfop May 9, 2024
1e48df1
Add python stuff
rachfop May 9, 2024
edbd990
update docs
rachfop May 9, 2024
0746a9a
updates
rachfop May 13, 2024
14c5a48
Merge main
rachfop May 20, 2024
9b72745
update schedules
rachfop May 20, 2024
e273764
Update index page
rachfop May 20, 2024
6bbaf45
Update index page
rachfop May 20, 2024
ca9e7dd
Update Python path
rachfop May 21, 2024
12e6e10
merge main
rachfop May 21, 2024
5c46025
fix broken go links
rachfop May 21, 2024
4278769
prose
rachfop May 21, 2024
a532a60
Apply suggestions from code review
May 23, 2024
ccf5680
landing page edits
May 23, 2024
5448a41
sm formatting for alignment across most of the guides
May 23, 2024
0312057
updating redirects
May 23, 2024
f02584e
links
May 23, 2024
746f9a4
fix unclosed escapes and broken anchors
May 23, 2024
ab4d558
slugs and links
May 23, 2024
e3d99c2
Merge branch 'main' into python-toc
May 23, 2024
9a3de6b
Update docs/develop/python/index.mdx
May 24, 2024
106f73f
Resolve merges
rachfop May 24, 2024
e3c8f8d
Merge branch 'main' into python-toc
rachfop May 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/dev-guide/golang/foundations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ And the total size of a gRPC message, which includes all the arguments, is limit
Also, keep in mind that all Payload data is recorded in the [Workflow Execution Event History](/workflows#event-history) and large Event Histories can affect Worker performance.
This is because the entire Event History could be transferred to a Worker Process with a [Workflow Task](/workers#workflow-task).

{/*TODO link to gRPC limit section when available */}
{/* TODO link to gRPC limit section when available */}

Some SDKs require that you pass context objects, others do not.
When it comes to your application data—that is, data that is serialized and encoded into a Payload—we recommend that you use a single object as an argument that wraps the application data passed to Activities.
Expand Down
2 changes: 1 addition & 1 deletion docs/dev-guide/javalang/durable-execution.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ The most important thing to take away from the section is to make sure you have

Versioning APIs and versioning strategies are covered in other parts of the developer's guide, this chapter sets the stage to understand why and how to approach those strategies.

{/*TODO ^ update with links to those places */}
{/* TODO ^ update with links to those places */}

### The Event History

Expand Down
2 changes: 1 addition & 1 deletion docs/dev-guide/javalang/foundations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ And the total size of a gRPC message, which includes all the arguments, is limit
Also, keep in mind that all Payload data is recorded in the [Workflow Execution Event History](/workflows#event-history) and large Event Histories can affect Worker performance.
This is because the entire Event History could be transferred to a Worker Process with a [Workflow Task](/workers#workflow-task).

{/*TODO link to gRPC limit section when available */}
{/* TODO link to gRPC limit section when available */}

Some SDKs require that you pass context objects, others do not.
When it comes to your application data—that is, data that is serialized and encoded into a Payload—we recommend that you use a single object as an argument that wraps the application data passed to Activities.
Expand Down
2 changes: 1 addition & 1 deletion docs/dev-guide/phplang/foundations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ And the total size of a gRPC message, which includes all the arguments, is limit
Also, keep in mind that all Payload data is recorded in the [Workflow Execution Event History](/workflows#event-history) and large Event Histories can affect Worker performance.
This is because the entire Event History could be transferred to a Worker Process with a [Workflow Task](/workers#workflow-task).

{/*TODO link to gRPC limit section when available */}
{/* TODO link to gRPC limit section when available */}

Some SDKs require that you pass context objects, others do not.
When it comes to your application data—that is, data that is serialized and encoded into a Payload—we recommend that you use a single object as an argument that wraps the application data passed to Activities.
Expand Down
108 changes: 0 additions & 108 deletions docs/dev-guide/python/index.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion docs/dev-guide/tscript/features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,7 @@ All interceptor methods are optional—it's up to the implementor to choose whic

### Interceptor examples

{/*TODO use snipsync*/}
{/* TODO use snipsync */}

**Log start and completion of Activities**

Expand Down
2 changes: 1 addition & 1 deletion docs/dev-guide/tscript/foundations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ And the total size of a gRPC message, which includes all the arguments, is limit
Also, keep in mind that all Payload data is recorded in the [Workflow Execution Event History](/workflows#event-history) and large Event Histories can affect Worker performance.
This is because the entire Event History could be transferred to a Worker Process with a [Workflow Task](/workers#workflow-task).

{/*TODO link to gRPC limit section when available */}
{/* TODO link to gRPC limit section when available */}

Some SDKs require that you pass context objects, others do not.
When it comes to your application data—that is, data that is serialized and encoded into a Payload—we recommend that you use a single object as an argument that wraps the application data passed to Activities.
Expand Down
4 changes: 4 additions & 0 deletions docs/dev-guide/tscript/observability.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ export async function greet(name: string): Promise<string> {
</details>

{/*

#### Customizing Activity logging with `ActivityOutboundCallsInterceptor`

FIXME(JWH): Quick introduction to `ActivityOutboundCallsInterceptor.getLogAttributes()`.
*/}

Expand Down Expand Up @@ -163,7 +165,9 @@ export async function myWorkflow(name: string): Promise<string> {
The Workflow Context Logger tries to avoid reemitting log messages on Workflow Replays.

{/*

#### Customizing Workflow logging using `WorkflowOutboundCallsInterceptor`

FIXME(JWH): Quick introduction to `WorkflowOutboundCallsInterceptor.getLogAttributes()`.
*/}

Expand Down
55 changes: 55 additions & 0 deletions docs/develop/python/asynchronous-activity-completion.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
id: asynchronous-activity-completion
title: Asynchronous Activity Completion
sidebar_label: Asynchronous Activity Completion
description: Complete an Activity without waiting for execution to finish, using Temporal Client and Activity Function.
slug: /develop/python/asynchronous-activity-completion
toc_max_heading_level: 2
keywords:
- asynchronous activity completion
- temporal python activities
- async activity execution
- temporal task token
- temporal activity heartbeat
- async activity updates
- temporal client for activities
- activity function async completion
tags:
- python
- python-sdk
- activities
- asynchronous-completion
---

## Asynchronously complete an Activity

**How to Asynchronously complete an Activity**

[Asynchronous Activity Completion](/activities#asynchronous-activity-completion) enables the Activity Function to return without the Activity Execution completing.

There are three steps to follow:

1. The Activity provides the external system with identifying information needed to complete the Activity Execution.
Identifying information can be a [Task Token](/activities#task-token), or a combination of Namespace, Workflow Id, and Activity Id.
2. The Activity Function completes in a way that identifies it as waiting to be completed by an external system.
3. The Temporal Client is used to Heartbeat and complete the Activity.

To mark an Activity as completing asynchronously, do the following inside the Activity.

```python
# Capture token for later completion
captured_token = activity.info().task_token
activity.raise_complete_async()
```

To update an Activity outside the Activity, use the [get_async_activity_handle()](https://python.temporal.io/temporalio.client.Client.html#get_async_activity_handle) method to get the handle of the Activity.

```python
handle = my_client.get_async_activity_handle(task_token=captured_token)
```

Then, on that handle, you can call the results of the Activity, `heartbeat`, `complete`, `fail`, or `report_cancellation` method to update the Activity.

```python
await handle.complete("Completion value.")
```
Loading