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
Migrate to a session based diff manager #371
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devdoshi
reviewed
Sep 30, 2020
devdoshi
reviewed
Sep 30, 2020
…hook into it's life cycle
…leaving serializing for transport to route handler
…Manager and close the event channel once the diff finishes
…mentations of it without additional integration
…rongly typed processing pipelines
…pes of diffs as well
JaapRood
force-pushed
the
feature/session-diffs
branch
from
October 13, 2020 09:58
60f3603
to
a6ed204
Compare
… as it currently breaks through spec changes
preventing unexplained exits from a worker implementation we're about to retire from holding us back.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, diffs of interactions vs spec happen on-demand, triggered from the UI. A lot of the logic for how to perform diffs and read the results were woven into the route handlers of the local
cli-server
. This is a first step in moving the diffing to the background and into a more reactive model.Mostly an exercise in exploring the right interface and model, this PR introduces a
Session
construct for each local API running against optic, and aSessionDiffs
manager, in charge of spawning and managing diff workers for said API. It does so through a genericDiff
interface, exposingDiffProgress
andDiffQueries
interfaces to the route handlers to interact with the diffs with. Results are generally returned asReadable
streams that can be piped straight through or manipulated. The existingDiffManager
is renamedOnDemandDiff
and implements this generic interface, putting it now fully in charge of matters like running the worker, persistence of results, etc.Behaviour wise, nothing has really changed thus far. It's still the UI starting the diff that's the main trigger for a diff being performed for now. However, this exercise in exploration and refactoring, puts us in a situation where we can implement a longer running, continuous type of diff, that be driven through other triggers. As long as the generic
Diff
interface is implemented, this can happen without changes to the route handlers or UI side.