Property | Type | Description | |
---|---|---|---|
$connection | A connection to the Google Cloud Platform API |
Method | Description | |
---|---|---|
__construct ( Google\Cloud\PubSub\Connection\ConnectionInterface $connection, string $projectId, string $name, boolean $encode, array $info = null ) | Create a PubSub topic. | |
__debugInfo ( ) : array | Present a nicer debug result to people using php 5.6 or greater. | |
create ( array $options = [] ) : array | Create a topic. | |
delete ( array $options = [] ) : void | Delete a topic. | |
exists ( array $options = [] ) : boolean | Check if a topic exists. | |
iam ( ) : |
Manage the IAM policy for the current Topic. | |
info ( array $options = [] ) : array | Get topic information. | |
name ( ) : string | Get the topic name | |
publish ( array $message, array $options = [] ) : array | Publish a new message to the topic. | |
publishBatch ( array $messages, array $options = [] ) : array | Publish multiple messages at once. | |
reload ( array $options = [] ) : array | Get topic information from the API. | |
subscribe ( string $name, array $options = [] ) : |
Create a subscription to the topic. | |
subscription ( string $name ) : |
This method will not run any API requests. You will receive a Subscription object that you can use to interact with the API. | |
subscriptions ( array $options = [] ) : Generator |
Retrieve a list of active subscriptions to the current topic. |
Method | Description | |
---|---|---|
formatMessage ( array $message ) : array | Ensure that the message is in a correct format, base64_encode the data, and error if the input is too wrong to proceed. | |
subscriptionFactory ( string $name, array $info = [] ) : |
Create a new subscription instance with the given name and optional subscription data. |
public __construct ( Google\Cloud\PubSub\Connection\ConnectionInterface $connection, string $projectId, string $name, boolean $encode, array $info = null ) | ||
$connection | Google\Cloud\PubSub\Connection\ConnectionInterface | A connection to the Google Cloud Platform service |
$projectId | string | The project Id |
$name | string | The topic name |
$encode | boolean | Whether messages should be base64 encoded. |
$info | array | [optional] A [Topic](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics) |
public __debugInfo ( ) : array | ||
return | array |
public publishBatch ( array $messages, array $options = [] ) : array | ||
$messages | array | A list of messages. Each message must be in the correct [Message Format](https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage). If provided, $data will be base64 encoded before being published, unless `$options['encode']` is set to false. (See below for more information.) } |
$options | array | [optional] Configuration Options |
return | array | A list of message IDs. |
public subscription ( string $name ) : |
||
$name | string | The subscription name |
return |
public subscriptions ( array $options = [] ) : Generator |
||
$options | array | [optional] { Configuration Options @type int $pageSize Maximum number of subscriptions to return. } |
return | Generator |