Skip to content

Commit 7324e3d

Browse files
committed
more review feedback
1 parent 0232640 commit 7324e3d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

limit.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ func (l *Limit[T]) Timeout(ctx context.Context, timeout time.Duration) (Limited[
131131

132132
// SetForeverMessaging returns a modified Limit that changes the behavior of Forever() so that
133133
// it will call stuckCallback() (if set) after waiting for stuckTimeout duration. If past that duration,
134-
// and it will call unstuckCallback() (if set) when it finally gets a limit.
134+
// and it will call unstuckCallback() (if set) when it finally gets a limit or if the context
135+
// is cancelled.
136+
//
137+
// The anticipated use of the callbacks is logging. They don't return error and if they panic,
138+
// it won't be caught by the simultaneous package.
135139
func (l Limit[T]) SetForeverMessaging(stuckTimeout time.Duration, stuckCallback func(context.Context), unstuckCallback func(context.Context)) *Limit[T] {
136140
l.stuckTimeout = stuckTimeout
137141
l.stuckCallback = stuckCallback

0 commit comments

Comments
 (0)