gunli commented on code in PR #1055:
URL: https://github.com/apache/pulsar-client-go/pull/1055#discussion_r1261916492


##########
pulsar/producer_partition.go:
##########
@@ -542,6 +538,11 @@ func (p *partitionProducer) internalSend(request 
*sendRequest) {
 
        uncompressedSize := len(uncompressedPayload)
 
+       // try to reserve memory for uncompressedPayload
+       if !p.canReserveMem(request, int64(uncompressedSize)) {
+               return

Review Comment:
   I think so, runCallback/releaseSemaphore/releaseMemory in canAddToQueue and 
canReserveMem violates the Single Responsibility Principle



-- 
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]

Reply via email to