You can resume a covered experience that was previously started and stored in the context. This is useful for distributed operations or when work spans multiple processes:
You can resume a covered experience that was previously started and stored in the context. This is useful for distributed operations or when work spans multiple processes.
Just like the start method, we can use a block to automatically complete a covered experience:
```ruby
# Resume an experience from context (with block)
@@ -133,6 +135,7 @@ Labkit::CoveredExperience.resume(:merge_request_creation) do |experience|
send_notifications
end
```
Or manually:
```ruby
# Resume an experience from context (manual control)
@@ -146,7 +149,7 @@ experience.checkpoint
experience.complete
```
**Note:** The `resume` method loads the start time from the Labkit context. If no experience data exists in the context, it behaves the same as calling methods on an unstarted experience (raises `UnstartedError` in development/test environments, or safely ignores in other environments).
**Note:** The `resume` method loads the start time from the Labkit context. If no covered experience data exists in the context, it behaves the same as calling methods on an unstarted experience (raises `UnstartedError` in development/test environments, or safely ignores in other environments).