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
**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.**
9
9
10
10
import Tabs from '@theme/Tabs';
11
11
import TabItem from '@theme/TabItem';
12
12
13
13
---
14
14
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:
16
16
17
17
|Status|Type|Description|
18
18
|--- |--- |--- |
@@ -25,13 +25,22 @@ Each Actor run has a status (the `status` field), which can be one of the follow
25
25
|`ABORTING`|transitional|Being aborted by user|
26
26
|`ABORTED`|terminal|Aborted by user|
27
27
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.
29
31
30
32

31
33
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
33
42
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:
35
44
36
45
<TabsgroupId="main">
37
46
<TabItemvalue="JavaScript"label="JavaScript">
@@ -47,6 +56,12 @@ await Actor.setStatusMessage('Crawled 45 of 100 pages');
47
56
awaitActor.exit();
48
57
```
49
58
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.
0 commit comments