Skip to content

Commit

Permalink
rename 'callback' to 'flushCallback'
Browse files Browse the repository at this point in the history
  • Loading branch information
gunli committed Jul 14, 2023
1 parent e936ab6 commit 37faf3a
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions pulsar/producer_partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -846,16 +846,14 @@ func (p *partitionProducer) internalSingleSend(mm *pb.MessageMetadata,
p._getConn().WriteData(buffer)
}

type pendingItemCallback func(err error)

type pendingItem struct {
sync.Mutex
buffer internal.Buffer
sequenceID uint64
sentAt time.Time
sendRequests []interface{}
completed bool
callback pendingItemCallback
buffer internal.Buffer
sequenceID uint64
sentAt time.Time
sendRequests []interface{}
completed bool
flushCallback func(err error)
}

func (p *partitionProducer) internalFlushCurrentBatch() {
Expand Down Expand Up @@ -1065,7 +1063,7 @@ func (p *partitionProducer) internalFlush(fr *flushRequest) {
return
}

pi.callback = func(err error) {
pi.flushCallback = func(err error) {
fr.err = err
close(fr.doneCh)
}
Expand Down Expand Up @@ -1378,8 +1376,8 @@ func (i *pendingItem) Complete(err error) {
}
i.completed = true
buffersPool.Put(i.buffer)
if i.callback != nil {
i.callback(err)
if i.flushCallback != nil {
i.flushCallback(err)
}
}

Expand Down

0 comments on commit 37faf3a

Please sign in to comment.