BewareMyPower opened a new pull request, #308: URL: https://github.com/apache/pulsar-client-cpp/pull/308
Fixes https://github.com/apache/pulsar-client-cpp/issues/306 ### Motivation `OpSendMsg` is a struct whose size is 400 bytes. We should avoid the copy operation on it. ### Modifications Pass the `unique_ptr<OpSendMsg>` everywhere instead of `OpSendMsg`. - Use `unique_ptr<OpSendMsg>` as the element of the pending message queue in `ProducerImpl` and disable the copy constructor and assignment for `OpSendMsg`. - Add `SendArgument`, which includes the necessary fields to construct a `CommandSend` request. Use `shared_ptr` rather than `unique_ptr` to store `SendArgument` in `OpSendMsg` because the producer might need to resend the message so the `SendArgument` object could be shared by `ProducerImpl` and `ClientConnection`. This patch is more like a refactor because the compiler optimization might reduce unnecessary copying. ### Documentation - [ ] `doc-required` (Your PR needs to update docs and you will update later) - [x] `doc-not-needed` (Please explain why) - [ ] `doc` (Your PR contains doc changes) - [ ] `doc-complete` (Docs have been already added) -- 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]
