Skip to content

Add AckDeadlineRenewer class for automatic ack deadline renewal - #1031

Merged
mziccard merged 4 commits into
googleapis:pubsub-alphafrom
mziccard:pubsub-renewer
Jun 3, 2016
Merged

mziccard merged 4 commits into
googleapis:pubsub-alphafrom
mziccard:pubsub-renewer

Conversation

@mziccard

Copy link
Copy Markdown
Contributor

This is a simpler version of #1024 to provide support for automatic ack deadline renewals

@mziccard mziccard added the api: pubsub Issues related to the Pub/Sub API. label May 27, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 27, 2016
@mziccard
mziccard force-pushed the pubsub-renewer branch 2 times, most recently from 681108a to d4f296e Compare May 27, 2016 18:59
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.002%) to 84.294% when pulling 01dbb40 on mziccard:pubsub-renewer into b872399 on GoogleCloudPlatform:pubsub-alpha.

@mziccard

ghost commented May 27, 2016

Copy link
Copy Markdown
Contributor Author

/cc @aozarov

* {@link #add(String, Iterable)}. The acknowledge deadlines of added messages are renewed until the
* messages are explicitly removed using {@link #remove(String, String)}.
*/
class AckDeadlineRenewer implements AutoCloseable {

This comment was marked as spam.

@mziccard

ghost commented Jun 1, 2016

Copy link
Copy Markdown
Contributor Author

@aozarov In d4b8f6c I refactored the tests to follow your suggestion. I also addressed other comments. I removed the fixed interval and now renewer is only scheduled when actually needed. PTAL

@coveralls

ghost commented Jun 1, 2016

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.3%) to 84.609% when pulling d4b8f6c on mziccard:pubsub-renewer into b872399 on GoogleCloudPlatform:pubsub-alpha.

@coveralls

ghost commented Jun 1, 2016

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.3%) to 84.608% when pulling 501ba7d on mziccard:pubsub-renewer into b872399 on GoogleCloudPlatform:pubsub-alpha.

}
for (Map.Entry<String, List<String>> entry : Multimaps.asMap(messagesToRenewNext).entrySet()) {
// We send all ack deadline renewals for a subscription
pubsub.modifyAckDeadlineAsync(entry.getKey(), MIN_DEADLINE_MILLIS,

This comment was marked as spam.

@aozarov

ghost commented Jun 1, 2016

Copy link
Copy Markdown
Contributor

Change looks good. Implementation looks good and api looks good (I provided one more minor suggestion). Maybe @lesv want to go over this code as well (I didn't pay attention to anything but API and impl).

super(PubSubFactory.class, PubSubRpcFactory.class, builder);
}

@Override

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@coveralls

ghost commented Jun 2, 2016

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.7%) to 84.977% when pulling 386269e on mziccard:pubsub-renewer into b872399 on GoogleCloudPlatform:pubsub-alpha.

@mziccard

ghost commented Jun 3, 2016

Copy link
Copy Markdown
Contributor Author

I am merging this, if @lesv has some more comments I'd be happy to address them in separate PRs.

@mziccard
mziccard merged commit e3a6d2e into googleapis:pubsub-alpha Jun 3, 2016
@lesv

ghost commented Jun 6, 2016

Copy link
Copy Markdown
Contributor

I'm happy with this change.

@release-please release-please Bot mentioned this pull request Aug 26, 2022
@release-please release-please Bot mentioned this pull request Sep 23, 2022
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.

5 participants