gunli commented on issue #1057:
URL:
https://github.com/apache/pulsar-client-go/issues/1057#issuecomment-1641274625
@Gleiphir2769 @RobertIndie Flush() just flush the message in the pending
queue..., I thought we intentionally designed it this way, so in #1042 I just
mentioned that Close() should consume the message int dataChan...
> Now we should clear dataChan and put all the messages to internalSent
before internalFlush.
I think the root cause is not the dataChan, pushing them into one channal
will restore another bug #687, besides, send message is a frequently call, use
a explicit type channel(chan *sendRequest) is better than a generic type
channel(chan interface{}).
I think we can improve it by these steps:
1. move the shema encoding, compressing logic from `internalSend` back to
`internalSendAsync` to make it like a JAVA client did;
2. consume the message in dataChan when we call Flush() and Close(). BTW, in
my opinion, Flush() is useless, 'cause in Flush() we don't update the state of
the producer, when we are in flushing, user can still call Send() to put new
message into the chan, unless we allow user to do that;
3. refactor the resource manage logic(request.done() we discussed before).
--
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]