Property | Type | Description | |
---|---|---|---|
$connection | Google\Cloud\PubSub\Connection\ConnectionInterface |
Method | Description | |
---|---|---|
__construct ( Google\Cloud\PubSub\Connection\ConnectionInterface $connection, string $projectId, string $name, string $topicName, boolean $encode, array $info = null ) | Create a Subscription. | |
__debugInfo ( ) : array | Present a nicer debug result to people using php 5.6 or greater. | |
acknowledge ( |
Acknowledge receipt of a message. | |
acknowledgeBatch ( array $messages, array $options = [] ) : void | Acknowledge receipt of multiple messages at once. | |
create ( array $options = [] ) : array | Execute a service request creating the subscription. | |
delete ( array $options = [] ) : void | Delete a subscription | |
exists ( array $options = [] ) : boolean | Check if a subscription exists. | |
iam ( ) : |
Manage the IAM policy for the current Subscription. | |
info ( array $options = [] ) : array | Get info on a subscription | |
modifyAckDeadline ( |
Set the acknowledge deadline for a single ackId. | |
modifyAckDeadlineBatch ( array $messages, integer $seconds, array $options = [] ) : void | Set the acknowledge deadline for multiple ackIds. | |
modifyPushConfig ( array $pushConfig, array $options = [] ) : void | Set the push config for the subscription | |
name ( ) : string | Get the subscription name | |
pull ( array $options = [] ) : Generator |
Retrieve new messages from the topic. | |
reload ( array $options = [] ) : array | Retrieve info on a subscription from the API. |
Method | Description | |
---|---|---|
getMessageAckIds ( array $messages ) : array | Get a list of ackIds from a list of Message objects. |
public __construct ( Google\Cloud\PubSub\Connection\ConnectionInterface $connection, string $projectId, string $name, string $topicName, boolean $encode, array $info = null ) | ||
$connection | Google\Cloud\PubSub\Connection\ConnectionInterface | The service connection object |
$projectId | string | The current project |
$name | string | The subscription name |
$topicName | string | The topic name the subscription is attached to |
$encode | boolean | Whether messages are encrypted or not. |
$info | array | [optional] Subscription info. Used to pre-populate the object. |
public __debugInfo ( ) : array | ||
return | array |
public acknowledge ( |
||
$message | A message object. | |
$options | array | [optional] Configuration Options |
return | void |
public create ( array $options = [] ) : array | ||
$options | array | [optional] { Configuration Options @type int $ackDeadlineSeconds This value is the maximum time after a subscriber receives a message before the subscriber should acknowledge the message. **Defaults to** `10`. @type array $pushConfig See {@see \Google\Cloud\PubSub\Subscription::modifyPushConfig()} or [PushConfig](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions#PushConfig) for usage. } |
return | array | An array of subscription info |
public iam ( ) : |
||
return |
public modifyAckDeadline ( |
||
$message | A message object | |
$seconds | integer | The new ack deadline with respect to the time this request was sent to the Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack deadline will expire 10 seconds after the ModifyAckDeadline call was made. Specifying zero may immediately make the message available for another pull request. |
$options | array | [optional] Configuration Options |
return | void |
public modifyAckDeadlineBatch ( array $messages, integer $seconds, array $options = [] ) : void | ||
$messages | array | An array of messages |
$seconds | integer | The new ack deadline with respect to the time this request was sent to the Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack deadline will expire 10 seconds after the ModifyAckDeadline call was made. Specifying zero may immediately make the message available for another pull request. |
$options | array | [optional] Configuration Options |
return | void |
public modifyPushConfig ( array $pushConfig, array $options = [] ) : void | ||
$pushConfig | array | { Push delivery configuration. See [PushConfig](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions#PushConfig) for more details. @type string $pushEndpoint A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push". @type array $attributes Endpoint configuration attributes. } |
$options | array | [optional] Configuration Options |
return | void |
public pull ( array $options = [] ) : Generator |
||
$options | array | [optional] { Configuration Options @type bool $returnImmediately If set, the system will respond immediately, even if no messages are available. Otherwise, wait until new messages are available. @type int $maxMessages Limit the amount of messages pulled. } |
return | Generator |