Add Timer sample for monthly subscription - #112
Open
sachinsharma3191 wants to merge 1 commit into
Open
Conversation
Implements issue temporalio#18 — a Timer sample matching the .NET reference. Uses Temporalio::Workflow.sleep for 30-day intervals, charges via an activity, and handles CanceledError for graceful cleanup. Includes a time-skipping test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Temporalio::Workflow.sleepfor 30-day intervals andTemporalio::Workflow.execute_activityto charge the userTemporalio::Error::CanceledErrorfor graceful workflow cancellationFiles
timer/subscription_workflow.rb— Subscription workflow with sleep loop and cancellationtimer/my_activities.rb— Simple Charge activitytimer/worker.rb— Worker registering workflow and activitytimer/starter.rb— Starts the subscription workflowtimer/README.md— Usage instructionstest/timer/subscription_workflow_test.rb— Time-skipping test verifying charge and cancellationREADME.md— Added timer to the samples listTest plan