Skip to content

Releases: googleapis/nodejs-pubsub

v0.4.0

08 Dec 20:59
Compare
Choose a tag to compare

⚠️ Breaking Changes

Promises have arrived!

Issue: #551
PR: #1702

It's been a long time coming, but we're finally here. We've shipped promise support in the Google Cloud Pub/Sub module!

Do I have to use promises?

Nope, carry on. (But keep reading if you use streams)

How do I use promises?

Don't pass a callback:

var pubsub = require('@google-cloud/pubsub')();

pubsub.getTopics()
  .then(function(data) {
    var topics = data[0];
  })
  .catch(function(err) {});

How do I use a method as a stream?

All of the streaming functionality from our methods have been moved to their own method.

var pubsub = require('@google-cloud/pubsub')();

- pubsub.getSubscriptions()
+ pubsub.getSubscriptionsStream()
    .on('data', function(subscription) {})

- pubsub.getTopics()
+ pubsub.getTopicsStream()
    .on('data', function(topic) {})
var topic = pubsub.topic('my-topic-name');

- topic.getSubscriptions()
+ topic.getSubscriptionsStream()
    .on('data', function(subscription) {})

v0.3.0

08 Dec 20:57
Compare
Choose a tag to compare

Features

  • #1535, #1590, #1605: Sync dependencies with other service modules to minimize download and installation time as much as possible.

v0.2.0

08 Dec 20:56
Compare
Choose a tag to compare

Fixes

  • #1418, #1563: Automatically update metadata on an object after calling getMetadata().
  • #1543, #1544: Upgrade gRPC dependency, which addresses a memory leak issue.