Skip to content

Conversation

@bshaffer
Copy link
Contributor

No description provided.

runtime: php55
api_version: 1
threadsafe: true
module: pubsub
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it should be service instead of module

namespace Google\Cloud\Samples\PubSub;

# [START create_push_subscription]
use Google\Cloud\ServiceBuilder;
Copy link
Contributor

@tmatsuo tmatsuo Sep 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about to use Google\Cloud\PubSub\PubSubClient like:

use Google\Cloud\PubSub\PubSubClient;
$pubSub = new PubSubClient([
    'projectId' => 'my_project'
]);

// Get an instance of a previously created topic.
$topic = $pubSub->topic('my_topic');

// Publish a message to the topic.
$topic->publish([
    'data' => 'My new message.',
    'attributes' => [
        'location' => 'Detroit'
    ]
]);

instead of using Google\Cloud\ServiceBuilder?

@bshaffer bshaffer merged commit df16171 into master Sep 18, 2016
@bshaffer bshaffer deleted the add-pubsub-veneer branch September 18, 2016 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants