https://github.com/aisk/throttlewriter
Simple and naïve throttle writer for go.
https://github.com/aisk/throttlewriter
Last synced: about 1 year ago
JSON representation
Simple and naïve throttle writer for go.
- Host: GitHub
- URL: https://github.com/aisk/throttlewriter
- Owner: aisk
- License: mit
- Created: 2019-01-11T05:22:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-11T05:30:26.000Z (over 7 years ago)
- Last Synced: 2025-01-28T12:23:00.530Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# throttlewriter
[](https://godoc.org/github.com/aisk/throttlewriter)

Simple and naïve throttle writer for go.
## Example
```go
package main
import (
"fmt"
"os"
"time"
"github.com/aisk/throttlewriter"
)
func main() {
writer := throttlewriter.New(os.Stdout, 10, time.Second)
i := 0
for {
i++
fmt.Fprintln(writer, i)
}
}
```
```sh
$ go run example.go
1
2
3
4
5
4383562
4383563
8795986
8795987
13150686
13150687
^Csignal: interrupt
```
## License
Licensed under either of
* MIT license ([LICENSE](LICENSE) or http://opensource.org/licenses/MIT)
at your option.