Skip to content

Commit

Permalink
comments edit
Browse files Browse the repository at this point in the history
  • Loading branch information
John Doe committed Jun 22, 2022
1 parent 796873e commit 010e1a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions multirepeater.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func NewMultiRepeater[ID comparable]() *MultiRepeater[ID] {
}

// Works almost same as original StartRepeater, but delegates stop function managment to MultiRepeater and requires id for repeater.
// Returns `true` on success, and `false` if given id is occupied.
// Returns `true` on success, and `false` if passed id is occupied.
func (mr *MultiRepeater[ID]) StartRepeater(id ID, frequency time.Duration, fnToCall func()) bool {
mr.mux.Lock()
if mr.repeaters[id] != nil {
Expand All @@ -32,7 +32,7 @@ func (mr *MultiRepeater[ID]) StartRepeater(id ID, frequency time.Duration, fnToC
return true
}

// Stops repeater by ID. Return `true` on success, and `false` if given id is not found.
// Stops repeater by ID. Return `true` on success, and `false` if passed id is not found.
func (mr *MultiRepeater[ID]) StopRepeater(id ID) bool {
mr.mux.Lock()
if mr.repeaters[id] == nil {
Expand Down
2 changes: 1 addition & 1 deletion repeater.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"time"
)

// Start repeating fnToCall with given frequency, frequency can be 0, if so, ticker won't be used.
// Start repeating fnToCall with passed frequency, frequency can be 0, if so, ticker won't be used.
// Use returned function to stop repeater, this function waits until repeater is stopped.
func StartRepeater(frequency time.Duration, fnToCall func()) (stop func()) {
if fnToCall == nil {
Expand Down

0 comments on commit 010e1a8

Please sign in to comment.