Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 18 additions & 4 deletions docs/application-development/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -2079,7 +2079,18 @@ const {yourActivity} = proxyActivities<typeof activities>({
</TabItem>
<TabItem value="python">

Content is not available
To create an Activity Retry Policy in Python, set the [RetryPolicy](https://python.temporal.io/temporalio.common.retrypolicy) class within the [`start_activity()`](https://python.temporal.io/temporalio.workflow.html#start_activity) or [`execute_activity()`](https://python.temporal.io/temporalio.workflow.html#execute_activity) function.

The following example sets the maximum interval to 2 seconds.

```python
workflow.execute_activity(
your_activity,
name,
start_to_close_timeout=timedelta(seconds=10),
retry_policy=RetryPolicy(maximum_interval=timedelta(seconds=2)),
)
```

</TabItem>
</Tabs>
Expand Down Expand Up @@ -2428,9 +2439,12 @@ To set a Heartbeat Timeout, use [`ActivityOptions.heartbeatTimeout`](https://typ
```typescript
// Creating a proxy for the activity.
const {longRunningActivity} = proxyActivities<typeof activities>({
scheduleToCloseTimeout: "5m", // translates to 300000 ms
startToCloseTimeout: "30s", // translates to 30000 ms
heartbeatTimeout: 10000, // equivalent to '10 seconds'
// translates to 300000 ms
scheduleToCloseTimeout: "5m",
// translates to 30000 ms
startToCloseTimeout: "30s",
// equivalent to '10 seconds'
heartbeatTimeout: 10000,
});
```

Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/what-is-the-temporal-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ A History shard maintains four types of queues:
- Replicator queue: asynchronously replicates Workflow Executions from active Clusters to other passive Clusters (experimental Multi-Cluster feature).
- Visibility queue: pushes data to the visibility index (Elasticsearch).

The History Service talks to the Matching Service and the Database.
The History Service talks to the Matching Service and the database.

- It uses grpcPort 7234 to host the service handler.
- It uses port 6934 for membership-related communication.
Expand Down
22 changes: 22 additions & 0 deletions docs/python/how-to-set-activity-retry-options-in-python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
id: how-to-set-an-activity-retry-policy-in-python
title: How to set an Activity Retry Policy in Python
sidebar_label: Retry Policy
description: Create an instance of an Activity Retry Policy in Python.
tags:
- python
- how-to
---

To create an Activity Retry Policy in Python, set the [RetryPolicy](https://python.temporal.io/temporalio.common.retrypolicy) class within the [`start_activity()`](https://python.temporal.io/temporalio.workflow.html#start_activity) or [`execute_activity()`](https://python.temporal.io/temporalio.workflow.html#execute_activity) function.

The following example sets the maximum interval to 2 seconds.

```python
workflow.execute_activity(
your_activity,
name,
start_to_close_timeout=timedelta(seconds=10),
retry_policy=RetryPolicy(maximum_interval=timedelta(seconds=2)),
)
```
5 changes: 5 additions & 0 deletions guide-gen/guide-configs/app-dev/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,11 @@
"title": "PHP",
"path": "php/how-to-set-activity-retry-options-in-php"
},
{
"lang": "python",
"title": "Python",
"path": "python/how-to-set-activity-retry-options-in-python"
},
{
"lang": "typescript",
"title": "TypeScript",
Expand Down
2 changes: 2 additions & 0 deletions snipsync.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ origins:
repo: samples-php
- owner: temporalio
repo: samples-typescript
- owner: temporalio
repo: samples-python
# Some samples were left in the SDK code itself because it has better testing
# capabilities than the samples repo
- owner: temporalio
Expand Down