code: func (up *UnbufferedPublisher) Publish(c context.Context, msgs ...*pubsub.Message) ([]string, error) {
  	if len(msgs) == 0 {
  		return nil, nil
  	}
  
  	messages := make([]*pb.PubsubMessage, len(msgs))
  	for i, msg := range msgs {
  		messages[i] = &pb.PubsubMessage{
  			Data:       msg.Data,
  			Attributes: msg.Attributes,
  		}
  	}
  
  	client, err := up.ClientFactory.Client(up.AECtx)
  	if err != nil {
  		return nil, err
  	}
  
  	resp, err := client.Publish(c, &pb.PublishRequest{
  		Topic:    string(up.Topic),
  		Messages: messages,
  	}, up.CallOpts...)
  	if err != nil {
  		// Optimistically recreate the client.
  		up.ClientFactory.RecreateClient()
  		logging.Debugf(c, "Recreating a new PubSub client due to error")
  		return nil, err
  	}
  	return resp.MessageIds, nil
  }
docs: // Publish publishes a message immediately, blocking until it completes.
  //
  // "c" must be an AppEngine context.