Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: logdog/appengine/coordinator/archivalPublisher.go

Issue 2989333002: [logdog] Replace Tumble with push queues. (Closed)
Patch Set: comments Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: logdog/appengine/coordinator/archivalPublisher.go
diff --git a/logdog/appengine/coordinator/archivalPublisher.go b/logdog/appengine/coordinator/archivalPublisher.go
index 1b8a87b9ae75b845304e6624650146762e6ed27f..e8eca7ea1024a1ec8d4f354221d9a2394f3713fe 100644
--- a/logdog/appengine/coordinator/archivalPublisher.go
+++ b/logdog/appengine/coordinator/archivalPublisher.go
@@ -17,11 +17,14 @@ package coordinator
import (
"time"
- gcps "cloud.google.com/go/pubsub"
- "github.com/golang/protobuf/proto"
+ "github.com/luci/luci-go/common/gcloud/pubsub"
log "github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/retry"
"github.com/luci/luci-go/logdog/api/endpoints/coordinator/services/v1"
+
+ gcps "cloud.google.com/go/pubsub"
+ "github.com/golang/protobuf/proto"
+
"golang.org/x/net/context"
)
@@ -39,14 +42,8 @@ type ArchivalPublisher interface {
}
type pubsubArchivalPublisher struct {
- // client is Pub/Sub client used by the publisher.
- //
- // This client is owned by the prodServicesInst that created this instnace,
- // and should not be closed on shutdown here.
- client *gcps.Client
-
- // topic is the authenticated Pub/Sub topic handle to publish to.
- topic *gcps.Topic
+ // publisher is the client used to publish messages.
+ publisher pubsub.Publisher
// publishIndexFunc is a function that will return a unique publish index
// for this request.
@@ -75,7 +72,7 @@ func (p *pubsubArchivalPublisher) Publish(c context.Context, t *logdog.ArchiveTa
"key": t.Key,
}.Infof(c, "Publishing archival message for stream.")
- _, err := p.topic.Publish(c, &msg).Get(c)
+ _, err := p.publisher.Publish(c, &msg)
return err
}, func(err error, d time.Duration) {
log.Fields{
« no previous file with comments | « logdog/appengine/cmd/coordinator/vmuser/queue.yaml ('k') | logdog/appengine/coordinator/coordinatorTest/context.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698