File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33[ ![ Build & Test Action Status] ( https://github.com/devnw/stream/actions/workflows/build.yml/badge.svg )] ( https://github.com/devnw/stream/actions )
44[ ![ Go Report Card] ( https://goreportcard.com/badge/go.atomizer.io/stream )] ( https://goreportcard.com/report/go.atomizer.io/stream )
55[ ![ codecov] ( https://codecov.io/gh/devnw/stream/branch/main/graph/badge.svg )] ( https://codecov.io/gh/devnw/stream )
6- [ ![ Go Reference] ( https://pkg.go.dev/badge/go.atomizer.io/stream.svg )] ( https://go.atomizer.io/stream )
6+ [ ![ Go Reference] ( https://pkg.go.dev/badge/go.atomizer.io/stream.svg )] ( https://pkg.go.dev/ go.atomizer.io/stream )
77[ ![ License: Apache 2.0] ( https://img.shields.io/badge/license-Apache-blue.svg )] ( https://opensource.org/licenses/Apache-2.0 )
88[ ![ PRs Welcome] ( https://img.shields.io/badge/PRs-welcome-brightgreen.svg )] ( http://makeapullrequest.com )
99
@@ -18,6 +18,12 @@ To install the package, run:
1818 go get -u go.atomizer.io/stream@latest
1919```
2020
21+ ## Usage
22+
23+ ``` go
24+ import " go.atomizer.io/stream"
25+ ```
26+
2127## Benchmarks
2228
2329To execute the benchmarks, run the following command:
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ type Scaler[T, U any] struct {
3838
3939 // WaitModifier is used to modify the Wait time based on the number of
4040 // times the Scaler has scaled up. This is useful for systems
41- // that are CPU bound and need to scale up more quickly.
41+ // that are CPU bound and need to scale up more/less quickly.
4242 WaitModifier DurationScaler
4343
4444 wScale * DurationScaler
@@ -225,6 +225,17 @@ type DurationScaler struct {
225225 // ScalingFactor is a value between -1 and 1 that is used to modify the
226226 // time.Duration of a ticker or timer. The value is multiplied by
227227 // the ScalingFactor is multiplied by the duration for scaling.
228+ //
229+ // For example, if the ScalingFactor is 0.5, then the duration will be
230+ // multiplied by 0.5. If the ScalingFactor is -0.5, then the duration will
231+ // be divided by 0.5. If the ScalingFactor is 0, then the duration will
232+ // not be modified.
233+ //
234+ // A negative ScalingFactor will cause the duration to decrease as the
235+ // step value increases causing the ticker or timer to fire more often
236+ // and create more routines. A positive ScalingFactor will cause the
237+ // duration to increase as the step value increases causing the ticker
238+ // or timer to fire less often and create less routines.
228239 ScalingFactor float64
229240
230241 // originalDuration is the time.Duration that was passed to the
You can’t perform that action at this time.
0 commit comments