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

push sync results to the client when background worker has finished #2207

Open
githubbob42 opened this issue May 4, 2019 · 1 comment
Open
Labels

Comments

@githubbob42
Copy link
Owner

Mingle Card: 2450
See #2439 for story details.

Task

When the background process (card #2448) has completed, it will push a sync result into a known db environment (probably mongodb). The web worker needs to take this sync result, and send it to the client.

Mechanically, either the client will poll the server for sync results, or the server will use WebSockets (maybe socket.io) to push the payload to the client. In either case, the correlation id will be stored with the sync result.

If the implementation uses client polling, the server will simply return a record from the database that matches the correlation Id.

If the client uses websockets, use either tailable cursors or db polling from the server to check for new sync results. When new sync results are available, the server should write the payload to the socket that matches the correlation id. If no client exists matching the correlation id (either because the connection was made on a separate node, or because the client has disconnected), the server can safely skip to the next cursor result. In the case of multiple web nodes, each node will be iterating over each new sync result, so sync payloads will be able to be sent on the same socket created the request.

@githubbob42
Copy link
Owner Author

Story: #2196 User initiates a sync request on the client (Mingle)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant