Skip to content

Commit

Permalink
Adapt functions and repository names
Browse files Browse the repository at this point in the history
After accepting pull request #6 I renamed Broadcasting() to
BroadcastFor() and ContinuousBroadcasting() to Broadcast().
Just these names are shorter.

Old Broadcasting() call saved for API backward compatibility.
  • Loading branch information
grafov committed Apr 6, 2015
1 parent 0520433 commit 9ea08ed
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions bcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,18 @@ func (r *Group) Close() {
r.close <- true
}

// Obsoleted by BroadcastFor()
func (r *Group) Broadcasting(timeout time.Duration) {
r.BroadcastFor(timeout)
}

// Broadcast messages received from one group member to others.
// If incoming messages not arrived during `timeout` then function returns.
// Set `timeout` to zero to set unlimited timeout or use Broadcasting().
func (r *Group) Broadcasting(timeout time.Duration) {
func (r *Group) BroadcastFor(timeout time.Duration) {
if timeout == 0 {
r.Broadcast()
return
}
for {
select {
case received := <-r.in:
Expand Down Expand Up @@ -121,8 +129,8 @@ func (r *Group) Broadcasting(timeout time.Duration) {
}

// Broadcast messages received from one group member to others.
// See https://github.com/NimbleIndustry/bcast/issues/4 for rationale
func (r *Group) ContinuousBroadcasting() {
// See https://github.com/grafov/bcast/issues/4 for rationale.
func (r *Group) Broadcast() {
for {
select {
case <-r.close:
Expand Down

0 comments on commit 9ea08ed

Please sign in to comment.