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

Currently sensing last line change Create action. Propose to extend to sense any line change and the nature of that change. #2

Open
gedw99 opened this issue May 26, 2023 · 1 comment

Comments

@gedw99
Copy link

gedw99 commented May 26, 2023

It is currently sensing the changes on the tail of the file and missing any change above the last line that an Actor does.

I plan to extend to sense any change in any part of the file, as well as the nature of the change ( Create, Update, Delete).
This will give it CDC ( Change Data Capture ) properties, making the code more able to cope with different use cases.

The existing tailing will be unchanged so will not break the API or logic / behaviors you depend on from this code.


Another use case is do exactly the same style of sensing but on a whole File Hierarchy. So the server would be given a Folder path, and do Directory level change detection as well as File level change detection.

@gedw99 gedw99 changed the title Only sensing last line change Create action. Propose to extend to sense any line and nature of change. Currently sensing last line change Create action. Propose to extend to sense any line change and the nature of that change. May 26, 2023
@gedw99
Copy link
Author

gedw99 commented May 26, 2023

The easiest way to add the CDC is to add a second phase.

The chronology of the code is like this:

  1. File change detected, which already works now.

  2. Run a diff of after against before using standard Unified Diff protocols. That will give the change and nature of the change

  3. Log out to cli.

  4. Then it is up to the developer what they want to do with that. Typically you Broadcast it and the other actor patches or does a transformation based on custom logic.


Note that the current tailing fails in that it gives the wrong answer to the cli when a change is made anywhere with the file. It works correctly with creates on the last line only.

Repository owner deleted a comment from chenwynn Mar 19, 2024
@github-staff github-staff deleted a comment from thangtq-pionero Apr 26, 2024
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