Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Change event handlers don't report removals for Input::add_event() #583
In the Input Framework,
Consider the attached script. Run it sniffing e.g. on lo to keep it going. With data.txt in place, it will report addition of the contents of the file, as expected. For updates, no removal event is generated, and an
Now copy data.txt into place:
Now copy data-small.txt over data.txt:
This is a bug, no?
Unqualified opinion: current behavior looks ok, docs may need improvement.
The event-based input stream implies there's no backing state or definition of what "key" to use for the dataset so every re-read has to report each entry as "new". e.g. if you have two entries,
So think the implication is "table-based streams track the state of the data set and so can provide more detailed change/removal information, but event-based streams do not store any state as the data set gets (re)read and can't report changes/removals".
Yep, if the docs spell it out accordingly, that would be fine with me. Right now I feel the text suggests that it works the same as for the table-driven approach.
Ok, will leave the issue open as a documentation enhancement in case no one else chimes in to call it out as a bug.
Yeah, I was also confused by its presence.
Yeah, or placeholder in case we come up with other event types in the future that make sense, but my thinking was for change/remove events you end up implementing that by way of storing a table of entries, at which point it's the same thing as a table-based input stream.