Skip to content

Commit 0a691be

Browse files
committed
fix(rivetkit): remove deprecated actor options
1 parent 087737c commit 0a691be

28 files changed

Lines changed: 42 additions & 215 deletions

File tree

examples/experimental-durable-streams-ai-agent-vercel/src/actors.ts

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/experimental-durable-streams-ai-agent/src/index.ts

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/kitchen-sink-vercel/frontend/page-data.ts

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/kitchen-sink-vercel/src/actors/lifecycle/sleep.ts

Lines changed: 0 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/kitchen-sink-vercel/src/index.ts

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/kitchen-sink/frontend/page-data.ts

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/kitchen-sink/src/actors/lifecycle/sleep.ts

Lines changed: 0 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/kitchen-sink/src/index.ts

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rivetkit-rust/packages/rivetkit-core/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
## Sleep state invariants
99

10-
- Any mutation that changes a `can_sleep` input must call `ActorContext::reset_sleep_timer()` so the `ActorTask` sleep deadline is re-evaluated. Inputs are: `ready`/`started`, `no_sleep`, `active_http_request_count`, `sleep_keep_awake_count`, `sleep_internal_keep_awake_count`, `pending_disconnect_count`, `conns()`, and `websocket_callback_count`. Missing this call leaves the sleep timer armed against stale state and triggers the `"sleep idle deadline elapsed but actor stayed awake"` warning on the next tick.
10+
- Any mutation that changes a `can_sleep` input must call `ActorContext::reset_sleep_timer()` so the `ActorTask` sleep deadline is re-evaluated. Inputs are: `ready`/`started`, `active_http_request_count`, `sleep_keep_awake_count`, `sleep_internal_keep_awake_count`, `pending_disconnect_count`, `conns()`, and `websocket_callback_count`. Missing this call leaves the sleep timer armed against stale state and triggers the `"sleep idle deadline elapsed but actor stayed awake"` warning on the next tick.
1111
- Runtime-owned promises that must drain during shutdown should use `ActorContext::register_task(...)`, not public `wait_until(...)`, so metrics and runtime intent stay distinct. Registered tasks must race user work against `shutdown_deadline_token()` so shutdown cannot hang forever.
1212
- `ctx.sleep()` and `ctx.destroy()` return `Result<()>`. They error with `ActorLifecycleError::Starting` when called before startup completes and `ActorLifecycleError::Stopping` if the requested flag has already been set this generation (atomic `swap(true, ...)`). Internal idle-timer paths log and suppress the already-requested error.
1313
- The grace deadline path (`on_sleep_grace_deadline`) aborts the user `run` handle and cancels `shutdown_deadline_token()`. Foreign-runtime adapters running `onSleep` / `onDestroy` must observe that token via `tokio::select!` so SQLite teardown does not race user cleanup work.

rivetkit-rust/packages/rivetkit-core/src/actor/config.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ pub struct ActorConfig {
7474
pub on_migrate_timeout: Duration,
7575
pub action_timeout: Duration,
7676
pub sleep_timeout: Duration,
77-
pub no_sleep: bool,
7877
pub sleep_grace_period: Duration,
7978
pub sleep_grace_period_overridden: bool,
8079
pub connection_liveness_timeout: Duration,
@@ -109,7 +108,6 @@ pub struct ActorConfigInput {
109108
pub on_migrate_timeout_ms: Option<u32>,
110109
pub action_timeout_ms: Option<u32>,
111110
pub sleep_timeout_ms: Option<u32>,
112-
pub no_sleep: Option<bool>,
113111
pub sleep_grace_period_ms: Option<u32>,
114112
pub connection_liveness_timeout_ms: Option<u32>,
115113
pub connection_liveness_interval_ms: Option<u32>,
@@ -160,9 +158,6 @@ impl ActorConfig {
160158
if let Some(value) = config.sleep_timeout_ms {
161159
actor_config.sleep_timeout = duration_ms(value);
162160
}
163-
if let Some(value) = config.no_sleep {
164-
actor_config.no_sleep = value;
165-
}
166161
if let Some(value) = config.sleep_grace_period_ms {
167162
actor_config.sleep_grace_period = duration_ms(value);
168163
actor_config.sleep_grace_period_overridden = true;
@@ -224,7 +219,6 @@ impl Default for ActorConfig {
224219
on_migrate_timeout: DEFAULT_ON_MIGRATE_TIMEOUT,
225220
action_timeout: DEFAULT_ACTION_TIMEOUT,
226221
sleep_timeout: DEFAULT_SLEEP_TIMEOUT,
227-
no_sleep: false,
228222
sleep_grace_period: DEFAULT_SLEEP_GRACE_PERIOD,
229223
sleep_grace_period_overridden: false,
230224
connection_liveness_timeout: DEFAULT_CONNECTION_LIVENESS_TIMEOUT,

0 commit comments

Comments
 (0)