docs(pubsub): add exactly-once samples#5442
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5442 +/- ##
==========================================
- Coverage 97.74% 97.74% -0.01%
==========================================
Files 216 216
Lines 47549 47549
==========================================
- Hits 46478 46477 -1
- Misses 1071 1072 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| let id = random_subscription_id(); | ||
| subscription_names.push(format!("projects/{project_id}/subscriptions/{id}")); | ||
| subscription::create_subscription_exactly_once::sample(&client, &project_id, topic_id, &id) |
There was a problem hiding this comment.
Do we need some cleanup here to delete the subscription ? The previous samples run the delete sample as the last one, which works as a clean up.
There was a problem hiding this comment.
oh I see, run_subscription_samples receives a subscription_names list to be filled with things to be deleted later.
There was a problem hiding this comment.
Yep, but you're right that this deserves a comment for context.
My next PR is going to add a comment around the delete subscription line that says it's just for testing a sample, and that all the other deletes are performed by the caller.
Fixes #5434 fixes #5438