wenfengwang commented on a change in pull request #32: Adding common API for
producer and consumer
URL: https://github.com/apache/rocketmq-client-go/pull/32#discussion_r259308973
##########
File path: remote/client.go
##########
@@ -59,42 +65,42 @@ type ClientConfig struct {
type defaultClient struct {
//clientId string
config ClientConfig
- conn net.Conn
+ conn net.Conn
// requestId
opaque int32
// int32 -> ResponseFuture
responseTable sync.Map
codec serializer
- exitCh chan interface{}
+ exitCh chan interface{}
}
-func NewRemotingClient(config ClientConfig) (RemotingClient, error) {
- client := &defaultClient{
- config: config,
- }
-
- switch config.CType {
- case Json:
- client.codec = &jsonCodec{}
- case RocketMQ:
- client.codec = &rmqCodec{}
- default:
- return nil, errors.New("unknow codec")
- }
-
- conn, err := net.Dial("tcp", config.RemotingAddress)
- if err != nil {
- log.Error(err)
- return nil, err
- }
- client.conn = conn
- go client.listen()
- go client.clearExpiredRequest()
- return client, nil
-}
-
-func (client *defaultClient) InvokeSync(request *remotingCommand)
(*remotingCommand, error) {
+//func newRemotingClient(config ClientConfig) error {
Review comment:
Keep it for now, and decide later whether should be deleted
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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