Skip to content

Commit

Permalink
broker: better func name
Browse files Browse the repository at this point in the history
  • Loading branch information
travisjeffery committed Sep 5, 2017
1 parent 027b58e commit 1fe8536
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions broker/replicator.go
Expand Up @@ -7,8 +7,7 @@ import (
"github.com/travisjeffery/jocko/protocol"
)

// Replicator fetches from the partition's leader and produces to a follower
// thereby replicating the partition
// Replicator fetches from the partition's leader producing to itself the follower, thereby replicating the partition.
type Replicator struct {
replicaID int32
partition *jocko.Partition
Expand All @@ -23,7 +22,7 @@ type Replicator struct {
leader jocko.Client
}

// NewReplicator returns a new replicator object
// NewReplicator returns a new replicator instance.
func NewReplicator(partition *jocko.Partition, replicaID int32, opts ...ReplicatorFn) *Replicator {
r := &Replicator{
partition: partition,
Expand All @@ -37,7 +36,7 @@ func NewReplicator(partition *jocko.Partition, replicaID int32, opts ...Replicat
}

go r.fetchMessages()
go r.writeMessages()
go r.appendMessages()

return r
}
Expand Down Expand Up @@ -78,7 +77,7 @@ func (r *Replicator) fetchMessages() {
}
}

func (r *Replicator) writeMessages() {
func (r *Replicator) appendMessages() {
for {
select {
case <-r.done:
Expand Down

0 comments on commit 1fe8536

Please sign in to comment.