Gleiphir2769 commented on code in PR #921:
URL: https://github.com/apache/pulsar-client-go/pull/921#discussion_r1057470413
##########
pulsar/consumer_partition.go:
##########
@@ -138,15 +138,14 @@ type partitionConsumer struct {
// the size of the queue channel for buffering messages
queueSize int32
queueCh chan []*message
- startMessageID trackingMessageID
+ startMessageID atomicMessageID
Review Comment:
> Could `atomic.Value{}` instead of this?
I think atomicMessageID is better than `atomic.Value{}` because it's more
simple and clearly.
For example, if we use `atomic.Value` as the startMessageID type, the
original using of `startMessageID` will be like this.
``` golang
// original
return pc.startMessageID.greater(msgID.messageID)
// atomicMessageID
return pc.startMessageID.get().greater(msgID.messageID)
// atomic.Value{}
return pc.startMessageID.Load().(trackingMessageID).greater(msgID.messageID)
```
`atomic.Value{}` will need one more time type assertion.
But `atomicMessageID` may need a better name and declear position. Do you
have more idea? Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]