Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: common/clock/external.go

Issue 1679023005: Add Context cancellation to clock. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Much more invasive, cancel by default, remove meter package. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: common/clock/external.go
diff --git a/common/clock/external.go b/common/clock/external.go
index acca11b0cdc651295b391da3426ffb8c35655e66..0426a771f52299a0015a8fbdced5316c9b208df6 100644
--- a/common/clock/external.go
+++ b/common/clock/external.go
@@ -50,16 +50,16 @@ func Now(ctx context.Context) time.Time {
// Sleep calls Clock.Sleep on the Clock instance stored in the supplied Context.
func Sleep(ctx context.Context, d time.Duration) {
- Get(ctx).Sleep(d)
+ Get(ctx).Sleep(ctx, d)
}
// NewTimer calls Clock.NewTimer on the Clock instance stored in the supplied
// Context.
func NewTimer(ctx context.Context) Timer {
- return Get(ctx).NewTimer()
+ return Get(ctx).NewTimer(ctx)
}
// After calls Clock.After on the Clock instance stored in the supplied Context.
-func After(ctx context.Context, d time.Duration) <-chan time.Time {
- return Get(ctx).After(d)
+func After(ctx context.Context, d time.Duration) <-chan AfterResult {
+ return Get(ctx).After(ctx, d)
}

Powered by Google App Engine
This is Rietveld 408576698