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
{{ message }}
Repository navigation
Commit f751833
Browse filesBrowse the repository at this point in the historyBrowse files
Review found that the billing workflow continued as new only with an
empty queue, and the game room workflow never did. Both now continue as
new when Temporal suggests it and carry their state into the new run.
Both still pass the time-skipping check. That check does not reach the
Continue-As-New branch, and the page says so.
Copy file name to clipboardExpand all lines: docs/compare/temporal.md
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ The task: a Rails 8 app on PostgreSQL syncs each customer's subscription with an
59
59
60
60
### With the Temporal Ruby SDK
61
61
62
-
There is one `CustomerBillingWorkflow` for each customer. This code follows the Temporal Ruby documentation. On October 18, 2026, it ran with the `temporalio` gem in the Temporal time-skipping test environment: three updates reached the billing API in order, and a failed push ran again with the same key. The Solid Objects test suite does not run it.
62
+
There is one `CustomerBillingWorkflow` for each customer. This code follows the Temporal Ruby documentation. On October 18, 2026, it ran with the `temporalio` gem in the Temporal time-skipping test environment: three updates reached the billing API in order, and a failed push ran again with the same key. The Continue-As-New branch did not run in that check. The Solid Objects test suite does not run it.
63
63
64
64
```ruby
65
65
require"temporalio/activity"
@@ -91,7 +91,7 @@ class CustomerBillingWorkflow < Temporalio::Workflow::Definition
- Workflow code must be deterministic. It cannot read Active Record or call the billing API. The activity does that.
151
152
- The state (`@pending` and `@last_synced_version`) lives in the event history, not in your tables. The app reads `last_synced_version` with a query.
152
153
- Temporal counts the attempts of each activity. This workflow does not copy the retry count or the next retry time into its own state.
153
-
- Each signal and each activity adds events to the history. The history is "limited to 51,200 Events or 50 MB", so the workflow continues as new when Temporal suggests it and no update is pending.
154
+
- Each signal and each activity adds events to the history. The history is "limited to 51,200 Events or 50 MB", so the workflow continues as new when Temporal suggests it. It carries the pending updates into the new run.
154
155
- Activities run at least once. The docs say that an activity "may be executed multiple times". The billing API must accept the idempotency key.
155
156
- You operate a Temporal Service, or you use Temporal Cloud, and you run a worker process beside the Rails app.
156
157
@@ -268,7 +269,7 @@ The task: turn-based game rooms in a Rails 8 app on PostgreSQL. Players send mov
268
269
269
270
### With the Temporal Ruby SDK
270
271
271
-
There is one `GameRoomWorkflow` for each room. This code also ran in the Temporal time-skipping test environment on October 18, 2026. A move out of turn was rejected, and the timer skipped a turn after 60 seconds.
272
+
There is one `GameRoomWorkflow` for each room. This code also ran in the Temporal time-skipping test environment on October 18, 2026. A move out of turn was rejected, and the timer skipped a turn after 60 seconds. The Continue-As-New branch did not run in that check.
272
273
273
274
```ruby
274
275
require"temporalio/workflow"
@@ -279,15 +280,17 @@ class GameRoomWorkflow < Temporalio::Workflow::Definition
- An update with a validator can reject a move, and the caller gets the error. A signal cannot do that. The server answers a signal "without waiting for the Workflow to process the Signal".
330
+
- The workflow continues as new when Temporal suggests it, and carries the room state into the new run. So a long game stays inside the history limit.
323
331
-`Temporalio::Workflow.timeout` starts a durable timer. "Timers are persisted", so the timer fires after a worker restart.
324
332
- The Action Cable channel calls `execute_update` on the workflow handle. The docs say that a client that sends an update "must wait until the Server delivers the Update to a Worker".
325
333
@@ -383,7 +391,7 @@ end
383
391
- With no key, `schedule(at:)` gives an actor one alarm for each operation. Each new turn moves the alarm, so one room has one timer.
384
392
- The reminder is a row in the database. Another process runs it after a restart.
385
393
386
-
[The tests](../../test/compare/game_room_test.rb) show that moves apply in the order they arrived, that a move out of turn or for an old turn is rejected, that a move moves the timer, and that the timer skips the turn after a restart.
394
+
[The tests](../../test/compare/game_room_test.rb) show that moves apply in the order they arrived, that a move out of turn or for an old turn is rejected, that a move moves the timer, that an old timeout behind a move does not skip the next turn, and that the timer skips the turn after a restart.
0 commit comments