feat(rivetkit): streamline workflow host APIs - #5578
Conversation
|
🚅 Deployed to the actors-pr-5578 environment in rivet-frontend
|
Review: feat(workflows): expose public workflow host APIsBig PR (60 files, ~4.3k additions) that exposes workflow host storage/queue/alarm/run-handler/inspector APIs across native and wasm runtimes, plus a new That said, I found two correctness issues in the parts of this PR the tests don't cover (wasm-only concurrency, and a specific failure-path interleaving), plus a few smaller cleanup items. Correctness1. wasm ActorEvent::RunWake => start_run_handler(callbacks, ctx),
If a workflow's 2. let due_run_wake = self.ctx.consume_due_run_wake().await?; // clears run_wake_at, returns T1
if let Err(error) = self.ctx.drain_overdue_scheduled_events().await {
if ... && let Some(wake_at) = due_run_wake
&& let Err(restore_error) = self.ctx.set_run_wake_at(Some(wake_at)).await
{ ... }
return Err(error);
}
...
if let Some(wake_at) = due_run_wake
&& let Err(error) = self.ctx.try_send_actor_event(ActorEvent::RunWake, "run_wake")
{
self.ctx.set_run_wake_at(Some(wake_at)).await?; // unconditional restore of T1
return Err(error).context("dispatch due run wake");
}
Convention3. New test uses Cleanup (dead code left behind by the refactor)
Design question (not blocking, but worth a second look)
Smaller: Performance (minor, non-blocking)
Nit
|
c7bb3fe to
7a74d1f
Compare
2884e4e to
0ff6164
Compare
817111f to
9546652
Compare
9546652 to
ec29bc9
Compare
ec29bc9 to
5d8757a
Compare
5d8757a to
c80488a
Compare
c80488a to
86c0443
Compare
86c0443 to
1550fe4
Compare
c.dbavailable by default and add experimental transactions that atomically include actor state.