Skip to content

Commit

Permalink
rate: change doc for ReserveN to reflect its signature
Browse files Browse the repository at this point in the history
Change-Id: I97299d5a90b4273f42cb992bcf05b3c4786a2ac7
Reviewed-on: https://go-review.googlesource.com/32239
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  • Loading branch information
songgao authored and bradfitz committed Oct 28, 2016
1 parent 711ca1c commit f51c127
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rate/rate.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,10 @@ func (lim *Limiter) Reserve() *Reservation {
// The Limiter takes this Reservation into account when allowing future events.
// ReserveN returns false if n exceeds the Limiter's burst size.
// Usage example:
// r, ok := lim.ReserveN(time.Now(), 1)
// if !ok {
// r := lim.ReserveN(time.Now(), 1)
// if !r.OK() {
// // Not allowed to act! Did you remember to set lim.burst to be > 0 ?
// return
// }
// time.Sleep(r.Delay())
// Act()
Expand Down

0 comments on commit f51c127

Please sign in to comment.