Skip to content

Commit 4217070

Browse files
authored
docs: improve status message doc (#1120)
rework logical flow add admonitions within code tabs relevant to respective language rework structure of the doc
1 parent 3ceb066 commit 4217070

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

sources/platform/actors/development/programming_interface/status_messages.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ slug: /actors/development/programming-interface/status-messages
55
sidebar_position: 3
66
---
77

8-
**Learn how to use custom status messages to inform users about the progress of an Actor.**
8+
**Learn how to use custom status messages to inform users about an Actor's progress.**
99

1010
import Tabs from '@theme/Tabs';
1111
import TabItem from '@theme/TabItem';
1212

1313
---
1414

15-
Each Actor run has a status (the `status` field), which can be one of the following values:
15+
Each Actor run has a status, represented by the `status` field. The following table describes the possible values:
1616

1717
|Status|Type|Description|
1818
|--- |--- |--- |
@@ -25,13 +25,22 @@ Each Actor run has a status (the `status` field), which can be one of the follow
2525
|`ABORTING`|transitional|Being aborted by user|
2626
|`ABORTED`|terminal|Aborted by user|
2727

28-
Additionally, the Actor run has a status message (the `statusMessage` field), which contains a text for users informing them what the Actor is currently doing, and thus greatly improve their user experience.
28+
## Status messages
29+
30+
In addition to the status, each Actor run has a status message (the `statusMessage` field). This message informs users about the Actor's current activity, enhancing the user experience.
2931

3032
![Status message](./images/status-message.png)
3133

32-
When an Actor exits, the status message is either automatically set to some default text (e.g. "Actor finished with exit code 1"), or to a custom message - see [exit](./basic_commands.md#exit-actor) method for details.
34+
## Exit status message
35+
36+
When an Actor exits, the status message is set to either:
37+
38+
- A default text (e.g., _Actor finished with exit code 1_)
39+
- A custom message (see the [exit](./basic_commands.md#exit-actor) method for details)
40+
41+
## Update status message
3342

34-
When the Actor is running, it should periodically update the status message as follows to keep users informed and happy. The function can be called as often as necessary, and the SDK only invokes API if the status changes. This is to simplify the usage.
43+
To keep users informed during the Actor's execution, update the status message periodically. Use the following code to set a status message:
3544

3645
<Tabs groupId="main">
3746
<TabItem value="JavaScript" label="JavaScript">
@@ -47,6 +56,12 @@ await Actor.setStatusMessage('Crawled 45 of 100 pages');
4756
await Actor.exit();
4857
```
4958

59+
:::note Update frequency
60+
61+
You can call the `setStatusMessage` function as often as needed. The SDK only invokes the API if the status changes, simplifying usage.
62+
63+
:::
64+
5065
</TabItem>
5166
<TabItem value="Python" label="Python">
5267

0 commit comments

Comments
 (0)