Skip to content

Commit

Permalink
io/ratelimit: add shared init
Browse files Browse the repository at this point in the history
  • Loading branch information
5aaee9 committed Jul 2, 2023
1 parent eca21c6 commit a4599c8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkgs/io/ratelimit/readwrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ func NewRateLimitReaderWriterCloser(underlay io.ReadWriteCloser, size uint64) io
}
}

func NewRateLimitReaderWriterCloserShared(underlay io.ReadWriteCloser, l *Limiter) io.ReadWriteCloser {
return &RateLimitReadWriteCloser{
limiter: l,
underlay: underlay,
}
}

func (r *RateLimitReadWriteCloser) Close() error {
return r.underlay.Close()
}
Expand Down

0 comments on commit a4599c8

Please sign in to comment.