func()

in app/pubsub-integration/pubsub/pubsub.go [91:109]


func (c *pubsubClient) NewTopic(topicID string, codec *goavro.Codec, batchSize int, numGoroutines int, maxOutstanding int) Topic {
	topic := c.client.Topic(topicID)

	if batchSize > 0 {
		topic.PublishSettings.CountThreshold = batchSize
	}
	if numGoroutines > 0 {
		topic.PublishSettings.NumGoroutines = numGoroutines // default is 25 * GOMAXPROCS
	}
	topic.PublishSettings.FlowControlSettings.LimitExceededBehavior = pubsub.FlowControlBlock
	if maxOutstanding > 0 {
		topic.PublishSettings.FlowControlSettings.MaxOutstandingMessages = maxOutstanding
	}
	return &pubsubTopic{
		id:    topicID,
		topic: topic,
		codec: codec,
	}
}