modifyAckDeadline() публичный Метод

Use {@see \Google\Cloud\PubSub\Subscription::modifyAckDeadlineBatch()} to modify the ack deadline for multiple messages at once. Example: $messages = $subscription->pull(); foreach ($messages as $message) { $subscription->modifyAckDeadline($message, 3); sleep(2); Now we'll acknowledge! $subscription->acknowledge($message); break; }
См. также: https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/modifyAckDeadline Modify Ack Deadline
public modifyAckDeadline ( Message $message, integer $seconds, array $options = [] ) : void
$message 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
Результат void
Пример #1
0
 public function testModifyAckDeadline()
 {
     $ackId = 'foobar';
     $this->connection->modifyAckDeadline(Argument::that(function ($args) use($ackId) {
         if ($args['foo'] !== 'bar') {
             return false;
         }
         if ($args['ackIds'] !== [$ackId]) {
             return false;
         }
         return true;
     }))->shouldBeCalledTimes(1);
     $subscription = new Subscription($this->connection->reveal(), 'subscription-name', 'topic-name', 'project-id');
     $subscription->modifyAckDeadline($ackId, 100, ['foo' => 'bar']);
 }