lizhimins opened a new pull request, #1300:
URL: https://github.com/apache/rocketmq-clients/pull/1300

   ## Summary
   
   Update the C++ client public API for consistency and simplify the client 
lifecycle state machine from 5 states to 3 states (CREATED → STARTED → STOPPED).
   
   ## Changes
   
   ### Public API
   - `SendCallback`: change signature from `const SendReceipt&` to 
`SendReceipt&&` (move semantics)
   - `Producer` / `FifoProducer`: sink parameter pattern for `Message`
   - `PushConsumer`: add `noexcept` to `shutdown()`, swallow exceptions in 
destructor
   - `SimpleConsumer`: `noexcept` shutdown, API updates
   
   ### Lifecycle State Machine
   - Simplify from 5 states to 3: `CREATED → STARTED → STOPPED`
   - `ClientImpl::start()` and `ClientImpl::shutdown()` remain virtual — 
subclasses override with explicit base class calls
   - Each subclass (`ProducerImpl`, `PushConsumerImpl`, `SimpleConsumerImpl`) 
manages its own state transition with `compare_exchange_strong`
   - `session_map_.clear()` added to `ClientImpl::shutdown()` before 
`client_manager_.reset()` to prevent use-after-free
   
   ### Internal Improvements
   - `RpcClientImpl`: `need_heartbeat_` changed to `std::atomic<bool>`
   - `ReceiveMessageStreamReader`: add `weak_ptr` check before use
   - `ClientManagerMock`: updated for new API signatures
   
   ## Testing
   - All 36 unit tests pass
   - Examples verified against real RocketMQ server (producer 10/10, async 5/5, 
FIFO 5/5, simple consumer, push consumer)


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