Skip to content

Commit 0869b57

Browse files
committed
improvements
1 parent 7653169 commit 0869b57

2 files changed

Lines changed: 2 additions & 11 deletions

File tree

docs/02_concepts/04_actor_events.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ and to remove them, you use the <ApiLink to="class/Actor#off">`Actor.off`</ApiLi
9191
{ActorEventsExample}
9292
</RunnableCodeBlock>
9393

94-
## Automatic state persistence with use_state
94+
## Automatic state persistence
9595

9696
The example above shows how to manually persist state using the `PERSIST_STATE` event. For most use cases, you can use the <ApiLink to="class/Actor#use_state">`Actor.use_state`</ApiLink> method instead, which handles state persistence automatically.
9797

docs/02_concepts/11_pay_per_event.mdx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,7 @@ Always check the charge limit in your Actor, whether through `ChargeResult` retu
5151

5252
## Advanced charging management
5353

54-
The <ApiLink to="class/ChargingManager">`ChargingManager`</ApiLink> (accessed via <ApiLink to="class/Actor#get_charging_manager">`Actor.get_charging_manager()`</ApiLink>) provides methods for fine-grained budget control:
55-
56-
- `get_max_total_charge_usd()` — the configured budget limit for this run.
57-
- `calculate_total_charged_amount()` — total USD charged so far.
58-
- `calculate_max_event_charge_count_within_limit(event_name)` — how many more events of this type can be charged before reaching the limit.
59-
- `get_charged_event_count(event_name)` — how many events of this type have been charged.
60-
- `is_event_charge_limit_reached(event_name)` — whether the remaining budget is too low for even one more event of this type.
61-
- `compute_chargeable()` — a dict of all event types and how many can still be charged.
62-
63-
These methods are useful for budget-aware crawling strategies, where you want to plan work based on the remaining budget rather than discovering the limit after the fact.
54+
For budget-aware crawling strategies, the <ApiLink to="class/ChargingManager">`ChargingManager`</ApiLink> (accessed via <ApiLink to="class/Actor#get_charging_manager">`Actor.get_charging_manager()`</ApiLink>) provides methods for querying the remaining budget, total charged amount, and per-event charge counts. This lets you plan work based on the remaining budget rather than discovering the limit after the fact. See the <ApiLink to="class/ChargingManager">`ChargingManager`</ApiLink> API reference for the full list of available methods.
6455

6556
<RunnableCodeBlock className="language-python" language="python">
6657
{AdvancedChargingExample}

0 commit comments

Comments
 (0)