This is an automated email from the ASF dual-hosted git repository.
tison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git
The following commit(s) were added to refs/heads/master by this push:
new 59c7eaee refactor: rename pendingItem.Complete() to
pendingItem.done() (#1109)
59c7eaee is described below
commit 59c7eaee9644bf99eee1b5e82540a847466ee8d4
Author: gunli <[email protected]>
AuthorDate: Tue Oct 24 14:32:18 2023 +0800
refactor: rename pendingItem.Complete() to pendingItem.done() (#1109)
Co-authored-by: gunli <[email protected]>
---
pulsar/producer_partition.go | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/pulsar/producer_partition.go b/pulsar/producer_partition.go
index ebd292ec..82123f98 100755
--- a/pulsar/producer_partition.go
+++ b/pulsar/producer_partition.go
@@ -862,7 +862,7 @@ type pendingItem struct {
sequenceID uint64
sentAt time.Time
sendRequests []interface{}
- completed bool
+ isDone bool
flushCallback func(err error)
}
@@ -1001,7 +1001,7 @@ func (p *partitionProducer) failTimeoutMessages() {
}
// flag the sending has completed with error, flush
make no effect
- pi.Complete(errSendTimeout)
+ pi.done(errSendTimeout)
pi.Unlock()
// finally reached the last view item, current
iteration ends
@@ -1076,7 +1076,7 @@ func (p *partitionProducer) internalFlush(fr
*flushRequest) {
pi.Lock()
defer pi.Unlock()
- if pi.completed {
+ if pi.isDone {
// The last item in the queue has been completed while we were
// looking at it. It's safe at this point to assume that every
// message enqueued before Flush() was called are now persisted
@@ -1281,7 +1281,7 @@ func (p *partitionProducer) ReceivedSendReceipt(response
*pb.CommandSendReceipt)
}
// Mark this pending item as done
- pi.Complete(nil)
+ pi.done(nil)
}
}
@@ -1365,7 +1365,7 @@ func (p *partitionProducer) failPendingMessages() {
}
// flag the sending has completed with error, flush make no
effect
- pi.Complete(errProducerClosed)
+ pi.done(errProducerClosed)
pi.Unlock()
// finally reached the last view item, current iteration ends
@@ -1452,11 +1452,11 @@ type flushRequest struct {
err error
}
-func (i *pendingItem) Complete(err error) {
- if i.completed {
+func (i *pendingItem) done(err error) {
+ if i.isDone {
return
}
- i.completed = true
+ i.isDone = true
buffersPool.Put(i.buffer)
if i.flushCallback != nil {
i.flushCallback(err)