-
Notifications
You must be signed in to change notification settings - Fork 160
Add support for TSP snapshot request #1194
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
base: main
Are you sure you want to change the base?
Conversation
Hey @rchiodo, thanks for doing this. Kyle's out until Friday, and I don't know as much of what's going on, so I'm going to assign to Kyle for now and let him review when he's back. Let me know if there's anything else you need in the meantime :) |
Thanks for letting me know :). No rush but I was worried Meta was no longer interested in TSP. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great, nice thought on the RecheckFinished
event. just a few suggestions, mostly to do with the test
/// Get access to the state for creating transactions | ||
fn state(&self) -> &Arc<State>; | ||
|
||
/// Get access to the recheck queue for async task processing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed this to process so that async events are processed in the tsp server (sometimes RecheckEvent is async). Seemed like DidChangeWatchedFiles notification causes an async event.
This PR adds another request handler for TSP = "typeServer/getSnapshot". The snapshot request is how the client side of a TSP connection indicates which 'state of the world' it's currently querying about. The server side keeps a 'snapshot' to indicate when the state of the world has changed.
Internally I used the 'epoch' and the 'RecheckFinished' event to indicate what the snapshot is and when it's changed.