Skip to content

Commit

Permalink
Copy ReceiveSettings.Partitions
Browse files Browse the repository at this point in the history
  • Loading branch information
tmdiep committed Nov 28, 2020
1 parent 02bc46e commit 00f6b95
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pubsublite/ps/settings.go
Expand Up @@ -39,8 +39,8 @@ const (
// KeyExtractorFunc is a function that extracts an ordering key from a Message.
type KeyExtractorFunc func(*pubsub.Message) []byte

// PublishMessageTransformerFunc transforms a pubsub.Message to a PubSubMessage
// API proto. If this returns an error, the pubsub.PublishResult will be
// PublishMessageTransformerFunc transforms a pubsub.Message to a Pub/Sub Lite
// PubSubMessage. If this returns an error, the pubsub.PublishResult will be
// errored and the PublisherClient will consider this a fatal error and
// terminate.
type PublishMessageTransformerFunc func(*pubsub.Message) (*pb.PubSubMessage, error)
Expand Down Expand Up @@ -126,13 +126,14 @@ func (s *PublishSettings) toWireSettings() wire.PublishSettings {
// be able to handle messages.
type NackHandler func(*pubsub.Message) error

// ReceiveMessageTransformerFunc transforms a PubSubMessage API proto to a
// ReceiveMessageTransformerFunc transforms a Pub/Sub Lite SequencedMessage to a
// pubsub.Message. If this returns an error, the SubscriberClient will consider
// this a fatal error and terminate.
type ReceiveMessageTransformerFunc func(*pb.SequencedMessage, *pubsub.Message) error

// ReceiveSettings configure the Receive method. These settings apply per
// partition.
// partition. If MaxOutstandingBytes is being used to bound memory usage, keep
// in mind the number of partitions in the associated topic.
//
// Use DefaultReceiveSettings for defaults, as an empty ReceiveSettings will
// fail validation.
Expand Down Expand Up @@ -180,6 +181,7 @@ func (s *ReceiveSettings) toWireSettings() wire.ReceiveSettings {
MaxOutstandingMessages: s.MaxOutstandingMessages,
MaxOutstandingBytes: s.MaxOutstandingBytes,
Timeout: s.Timeout,
Partitions: s.Partitions,
Framework: wire.FrameworkCloudPubSubShim,
}
}

0 comments on commit 00f6b95

Please sign in to comment.