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

Preserve the observer associated with an existing topic #37

Merged
merged 2 commits into from
Feb 8, 2018
Merged

Preserve the observer associated with an existing topic #37

merged 2 commits into from
Feb 8, 2018

Conversation

onlybakam
Copy link
Contributor

when a new request is executed, we need to make sure the observer intially associated with a topic is preserved. currently, on a new request, we disconnect all the clients and then reconnect them and associate them with the latest observer. When a subscription message is received, we then fetchthe observer with:

this.topicObserver.get(topic);

and call

observer.next(parsedMessage);

which will trigger a specific handler configured for that observer (the handler that subscribed to the observer returned by the execute function in QueryManager.startGraphQLSubscription.

The change keeps track of the previous value of topicObserver and retains the observer associated with an existing topic.

@manueliglesias manueliglesias self-requested a review February 8, 2018 21:41
Copy link
Contributor

@manueliglesias manueliglesias left a comment

Choose a reason for hiding this comment

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

👍

@manueliglesias manueliglesias merged commit 7803e42 into awslabs:master Feb 8, 2018
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.

2 participants