Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add amp-live-list manager #3094

Merged
merged 1 commit into from
May 5, 2016

Conversation

erwinmombay
Copy link
Member

@erwinmombay erwinmombay commented May 4, 2016

Add amp-live-list manager that handles the request/response cycle if there are multiple amp-live-list instances on a document.

@erwinmombay erwinmombay force-pushed the amp-live-list-manager branch 2 times, most recently from 29211fe to c1f6a9f Compare May 4, 2016 12:10
@erwinmombay
Copy link
Member Author

@dvoytenko PTAL

@erwinmombay erwinmombay force-pushed the amp-live-list-manager branch 4 times, most recently from e8cba50 to e49b2ab Compare May 4, 2016 17:29
@erwinmombay erwinmombay assigned cramforce and unassigned dvoytenko May 4, 2016
@erwinmombay
Copy link
Member Author

cc @cramforce

// Polling should always be stopped when document is no longer visible.
this.viewer_.onVisibilityChanged(() => {
if (this.viewer_.isVisible()) {
this.poller_.start();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this trigger an immediate invocation?

Copy link
Member Author

@erwinmombay erwinmombay May 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does not, it would queue up a timeout (with jitter).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The design doc says to do it, so that the time since last poll is taken into account.

I think that is pretty important. Basically when you return to a page after 5 minutes you want an immediate update.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, will fix

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added opt_isLeading param to start.

@cramforce
Copy link
Member

Looks great. A few questions/comments.

@erwinmombay erwinmombay force-pushed the amp-live-list-manager branch 4 times, most recently from c744338 to 53192c9 Compare May 5, 2016 01:15
// Polling should always be stopped when document is no longer visible.
this.viewer_.onVisibilityChanged(() => {
if (this.viewer_.isVisible()) {
this.poller_.start(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment for what the true means.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@erwinmombay erwinmombay force-pushed the amp-live-list-manager branch 2 times, most recently from a3534a0 to b6ac7ea Compare May 5, 2016 15:54
@erwinmombay
Copy link
Member Author

@cramforce PTAL

@cramforce
Copy link
Member

LGTM

@erwinmombay erwinmombay merged commit a32a1db into ampproject:master May 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants