Skip to content

Commit

Permalink
fix(pubsub): Remove NewMessage and NewPublishResult (#3232)
Browse files Browse the repository at this point in the history
Rolls back functions that we have decided not to expose to users.
  • Loading branch information
tmdiep committed Nov 19, 2020
1 parent 42d2ef0 commit a781a3a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
6 changes: 0 additions & 6 deletions pubsub/message.go
Expand Up @@ -61,12 +61,6 @@ type Message struct {
ackh ackHandler
}

// NewMessage creates a message with a custom ack/nack handler, which should not
// be nil.
func NewMessage(ackh ackHandler) *Message {
return &Message{ackh: ackh}
}

func toMessage(resp *pb.ReceivedMessage) (*Message, error) {
if resp.Message == nil {
return &Message{ackh: &psAckHandler{ackID: resp.AckId}}, nil
Expand Down
7 changes: 0 additions & 7 deletions pubsub/topic.go
Expand Up @@ -470,13 +470,6 @@ type PublishResult struct {
err error
}

// NewPublishResult returns the set() function to enable callers from outside
// this package to store and call it (e.g. unit tests).
func NewPublishResult() (*PublishResult, func(string, error)) {
result := &PublishResult{ready: make(chan struct{})}
return result, result.set
}

// Ready returns a channel that is closed when the result is ready.
// When the Ready channel is closed, Get is guaranteed not to block.
func (r *PublishResult) Ready() <-chan struct{} { return r.ready }
Expand Down

0 comments on commit a781a3a

Please sign in to comment.