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

Make resource handlers re-use connection objects when their endpoint changes #6

Open
harmony7 opened this issue Nov 19, 2015 · 0 comments

Comments

@harmony7
Copy link
Member

Justin noticed that Pollymer seemed not to be behaving as expected, as he was not seeing the "waiting X ms" notice between updates.

Upon investigation, I found that this is because every time the Link URL changes, a new connection is created, resulting in the creation of a brand new Pollymer object. Justin says that he expects Pollymer objects to be reused in this case.

In order to allow for multiplexing, the engine currently collects all resource handlers that have the same link URL and creates a single connection object that references all these resource handlers. Even in the case where multiplexing is not used, unrelated resources may happen to return the same wait link endpoints, and in this case a single connection object is used to represent both objects.

Because of this handling, it is possible to easily switch objects between multiplexing and singleplexing, or to multiplex-websockets when necessary.

In order to reuse Pollymer objects, it would need to become possible to track each resource handler from each connection, and then detect when an adjusted link URL points to one of the resource handlers referred to by an existing connection, and then mutate that connection. This could result in the branching of multiple connections from a single connection, or the converging of connections.

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

No branches or pull requests

1 participant