You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/06/16 02:20:29 UTC

[GitHub] [pulsar-client-go] LvBay commented on issue #281: producer.Send() blocks for too long time

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