pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [pulsar-client-go] LvBay commented on issue #281: producer.Send() blocks for too long time
Date Tue, 16 Jun 2020 02:20:29 GMT

LvBay commented on issue #281:
URL: https://github.com/apache/pulsar-client-go/issues/281#issuecomment-644490365


   ```
           ...
   	resp := make(chan struct{}, 1)
   	var err error
   	go func() {
   		sctx, cancel := context.WithTimeout(context.Background(), time.Second)
   		_, err = producer.Send(sctx, sendMsg)
   		cancel()
   		if err != nil {
   			log.Error("publish message failed", err, msg)
   		}
   		resp <- struct{}{}
   	}()
   	select {
   	case <-time.After(time.Second):
   	case <-resp:
   	}
           ...
   ```
   Yeah, passed
   @merlimat 


----------------------------------------------------------------
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:
users@infra.apache.org



Mime
View raw message