Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce gRPC support for pub/sub #210

Merged
merged 3 commits into from
Oct 18, 2016

Conversation

dwsupplee
Copy link
Contributor

@dwsupplee dwsupplee commented Oct 17, 2016

With this PR we now officially have gRPC support for pub/sub!

Perform the following installation:

$ pecl install grpc
$ composer require google/gax
$ composer require google/proto-client-php

... and the pub/sub client should automatically detect you are capable of using gRPC and enable that as the transport mechanism.

You can also toggle between REST/gRPC by providing the transport option when building your pub/sub client.

<?php
require 'vendor/autoload.php';

use Google\Cloud\PubSub\PubSubClient;

$pubSub = new PubSubClient([
    'projectId' => 'my_project',
    'transport' => 'REST'
]);

@dwsupplee dwsupplee added the api: pubsub Issues related to the Pub/Sub API. label Oct 17, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 17, 2016
return $response->serialize(new PhpArray());
}

return [];

This comment was marked as spam.

@@ -18,6 +18,8 @@
namespace Google\Cloud\PubSub;

use Google\Cloud\ClientTrait;
use Google\Cloud\Exception\GoogleException;

This comment was marked as spam.

@@ -119,35 +99,24 @@ class RequestWrapper
* @type int $retries Number of retries for a failed request.
* **Defaults to** `3`.
* @type array $scopes Scopes to be used for the request.
* @type boolean $shouldSignRequest Whether to enable request signing.
* @type bool $shouldSignRequest Whether to enable request signing.
* }
*/
public function __construct(array $config = [])

This comment was marked as spam.

* {@see Google\Cloud\ServiceBuilder::__construct()} for the available options.
* @param array $config [optional] {
* Configuration options. See
* {@see Google\Cloud\ServiceBuilder::__construct()} for the other available options.

This comment was marked as spam.

This comment was marked as spam.

@jdpedrie
Copy link
Contributor

Great work pal!

@dwsupplee
Copy link
Contributor Author

Updated! PTAL @jdpedrie

Copy link
Contributor

@jdpedrie jdpedrie left a comment

Choose a reason for hiding this comment

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

LGTM

@jdpedrie
Copy link
Contributor

@dwsupplee feel free to merge once Travis is done. I probably will be afk before CI is finished. :)

@dwsupplee dwsupplee merged commit 128b598 into googleapis:master Oct 18, 2016
@jdpedrie jdpedrie mentioned this pull request Nov 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants