Use {@see \Google\Cloud\PubSub\Subscription::modifyAckDeadline()} to
modify the ack deadline for a single message.
Example:
$messages = $subscription->pull();
$messagesArray = iterator_to_array($messages);
Set the ack deadline to a minute and a half from now for every message
$subscription->modifyAckDeadlineBatch($messagesArray, 3);
Delay execution, or make a sandwich or something.
sleep(2);
Now we'll acknowledge
$subscription->acknowledge($messagesArray);
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 |