Me1onRind opened a new issue #340: How about change TransactionListener's 
method param type from struct to pointer
URL: https://github.com/apache/rocketmq-client-go/issues/340
 
 
   When I try use transaction, I implement the interface,  I find the interface 
method's param is struct
   ```go
   // primitive/message.go
   type TransactionListener interface {
       ExecuteLocalTransaction(Message) LocalTransactionState
       CheckLocalTransaction(MessageExt) LocalTransactionState
   }
   ```
   I think passing struct isn't a efficient way. Then, my vim warning me  "copy 
locks"
   becuse struct Message and MessageExt anonymous inheritance sync.RWMutex
   ```go
   // primitive/message.go
   type Message struct {
       // other codes                                                           
                                                                                
         
       mutex      sync.RWMutex                                                  
                                                                                
                                
   }
   // ...
   type MessageExt struct {
       Message
       // other codes
   }                                                                            
                                                                                
      
   ```
   So I think mabey change TransactionListener to
   ```go
   type TransactionListener interface {
       ExecuteLocalTransaction(*Message) LocalTransactionState
       CheckLocalTransaction(*MessageExt) LocalTransactionState
   }
   ```
   will be better, if it will not case other bug.  If it's  ok, I can try to 
change it.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to